PDA

View Full Version : [Filled]-Latest releases // RSS feed


wooolF[RM]
01-24-2005, 08:03 PM
Well, this is kinda different from what people used to see.

Basically what is needed is RSS feed with latest/latest 5/latest 10 releases that came to FTP.

I know, you can always see it on IRC (if u run a sitebot). But what if u don't? Or you're not at home? This script requires some pretty hardcore skills and understanding in ioFTPD/XML/RSS and it should be a really challenge to any coder IMHO.

I'm not really asking to make such a script (tho' would really like to have one, no doubt). It's more like a question if that is possible at all, how to archieve it etc.


Any suggestions/comments are welcome.

Best regards, wooolF[RM]

Harm
01-25-2005, 01:01 AM
What about a script run by the scheduler every 5-10 minutes. It would parse ioFTPD.log, get the last 10 newly created dirs and then create the xml file according to the rss format.
It should of course be able to exclude some newdirs based on section or regexps that appear in the complete path (cd.*, etc.).
Finally, it might even send the feed to another server using ftp.exe or ncftpput.exe.

Another way would be a php script on your website that would parse ioFTPD.log itself to generate the xml page.

LoCaliSe
01-25-2005, 06:28 AM
Good Idea :)

Mouton
01-26-2005, 12:07 PM
Having some way to limit access would be good.

For example, by having an access URL like:
http://123.34.23.244/rss.php?u=username
the php script would validate that the request come from an IP allowed for the account 'username' and print the rss xml if it's ok, and nothing if not.
I don't know if io httpd & php extension has a variable for the request IP..? I think that would be the only blocker to such a script.

ADDiCT
01-26-2005, 12:39 PM
$_SERVER["REMOTE_ADDR"] works fine, have used it already in "ioHTTPD" on LAN-parties. On the internet u might have to deal with proxyservers (force users to disable them for the RSS-feed).

Edit: something i found between al my crappy code:
function FindUserIdByIP($ip)
{
$resultid = -1; // default return value

$userlist = io_user_list_init(); // create userlist
$usermask = io_user_mask_init(UINFO_IPLIST); // create usermask; we only need list of IP's

// fetch userid's
$uid = io_user_list_fetch($userlist);
while($resultid == -1 && $uid >= 0)
{
$userfile = io_user_open($uid); // open userfile
$a = io_user_query($userfile, $usermask); // get info
io_user_close($userfile); // close userfile

// check all IP's
for ($i=1; $i <= $a[0]; $i++)
{
// extract ip from "ident@ip" format
if (strpos($a[$i], "@") > 0) { $userip = substr($a[$i], strpos($a[$i],"@")+1, strlen($a[$i])); }
else { $userip = $a[$i]; }
if ($userip == $ip)
{
$resultid = $uid;
break;
}
}

// get next userid from list
$uid = io_user_list_fetch($userlist);
}

io_user_mask_close($usermask); // close usermask
io_user_list_close($userlist); // close userlist

return $resultid;
}

Mouton
01-26-2005, 02:00 PM
Anyone got a suggestion of a RSS feed reader with which I could test my script ?
ATM, I can allow or deny access using the IP or hostname depending on the specified account access masks, and I show all newdirs in rss items.
I'll probably parse the ioFTPD.log in 'real-time' (ie parse everything that appeared since last time it was parsed).

Mouton
01-26-2005, 06:03 PM
Done.
The only problem (and it's not working until we can find a way to fix this) it that io's httpd doesn't want to send xml...


<?php
header('Content-Type: text/xml');

echo "<?xml version='1.0' ?>\n\n";
echo "<text/>";
?>

This shows as text/xml when loaded in Apache2, but it's text/plain when loaded by io's httpd...
This seems to cause problems with rss readers, making them choke on the otherwise valid rss xml...

wooolF[RM]
01-27-2005, 11:14 AM
Originally posted by Mouton
Anyone got a suggestion of a RSS feed reader with which I could test my script ? FeedDemon (http://www.bradsoft.com/feeddemon/) / FeedReader (http://www.feedreader.com/)

wooolF[RM]
01-27-2005, 11:16 AM
Seems badass made something usefull:

http://badaas.ownage.ws/badRSS_1_0-io.zip

Any comments?

Mouton
01-27-2005, 11:27 AM
Looks awfully complicated for something that simple... but as long as it work for you, then I guess that's fine.

I'm about to post mine, even if some rss reader might choke on it.
RSSOwl (POTM on SourceForge.net) handles it just fine. Firefox Live Bookmark also works fine.

*edit: http://www.ioftpd.com/scripts/script.php?id=168

wooolF[RM]
01-27-2005, 11:40 AM
I haven't tested it yet... No mood... Still shocked after yesterday:
http://dd0s.org/~wooolf/carcrash/

SnypeTEST
01-27-2005, 02:12 PM
pwned. atleast ur still alive...

rootbox
08-31-2005, 11:05 AM
any updates?

Mouton´s version won´t work :(

Mouton
09-04-2005, 01:57 PM
It works just fine here.