! Requests Need a script or some sort of cool .bat file ? Ask here! |
01-24-2005, 08:03 PM
|
#1
|
Senior Member
ioFTPD Foundation User
Join Date: Oct 2003
Posts: 411
|
Latest releases // RSS feed
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]
|
|
|
01-25-2005, 01:01 AM
|
#2
|
Too much time...
Ultimate Scripter
Join Date: Jul 2003
Posts: 1,430
|
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.
|
|
|
01-25-2005, 06:28 AM
|
#3
|
Member
Join Date: Aug 2003
Posts: 48
|
Good Idea
|
|
|
01-26-2005, 12:07 PM
|
#4
|
Posse Member
Ultimate Scripter ioFTPD Administrator
Join Date: Dec 2002
Posts: 1,956
|
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.
|
|
|
01-26-2005, 12:39 PM
|
#5
|
Senior Member
FlashFXP Beta Tester ioFTPD Scripter
Join Date: Aug 2003
Posts: 517
|
$_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:
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;
}
|
|
|
01-26-2005, 02:00 PM
|
#6
|
Posse Member
Ultimate Scripter ioFTPD Administrator
Join Date: Dec 2002
Posts: 1,956
|
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).
|
|
|
01-26-2005, 06:03 PM
|
#7
|
Posse Member
Ultimate Scripter ioFTPD Administrator
Join Date: Dec 2002
Posts: 1,956
|
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...
Code:
<?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...
|
|
|
01-27-2005, 11:14 AM
|
#8
|
Senior Member
ioFTPD Foundation User
Join Date: Oct 2003
Posts: 411
|
Quote:
Originally posted by Mouton
Anyone got a suggestion of a RSS feed reader with which I could test my script ?
|
FeedDemon / FeedReader
|
|
|
01-27-2005, 11:27 AM
|
#10
|
Posse Member
Ultimate Scripter ioFTPD Administrator
Join Date: Dec 2002
Posts: 1,956
|
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
|
|
|
01-27-2005, 11:40 AM
|
#11
|
Senior Member
ioFTPD Foundation User
Join Date: Oct 2003
Posts: 411
|
I haven't tested it yet... No mood... Still shocked after yesterday:
http://dd0s.org/~wooolf/carcrash/
|
|
|
01-27-2005, 02:12 PM
|
#12
|
Senior Member
ioFTPD Scripter
Join Date: Feb 2003
Posts: 458
|
pwned. atleast ur still alive...
|
|
|
08-31-2005, 11:05 AM
|
#13
|
Junior Member
ioFTPD Foundation User
Join Date: Jul 2005
Posts: 1
|
any updates?
Mouton´s version won´t work
|
|
|
09-04-2005, 01:57 PM
|
#14
|
Posse Member
Ultimate Scripter ioFTPD Administrator
Join Date: Dec 2002
Posts: 1,956
|
It works just fine here.
|
|
|
Thread Tools |
|
Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
project-zs for ioFTPD
|
caladan |
Caladan's scripts |
278 |
08-02-2005 09:36 AM |
All times are GMT -5. The time now is 12:37 AM.
|