Alright, so if you've read my previous 2 posts, you should have a good understanding of how torrents work and how you could setup your own torrent. Now i'll explain how to use HFS (explained in part 2) to turn your torrents into items in an RSS feed.
The concept is fairly simple when compared to the bittorrent protocol itself. Essentially an RSS feed needs to have a link to the torrent file in the title, description, or enclosure of the item. HFS allows us to do this with a little tweak. I found this tweak on http://www.rarst.net/software/hfs-rss/ (original text below) and i got it working in less than 2 minutes. I currently use this to send home videos to all my family members. They all have utorrent running and subscribed to my feed. All i do is create the torrent and dump it into my HFS folder. They get the torrent from the rss feed and all start downloading it at the same time.
----------Original Article----------
I had previously covered HFS which is excellent software for setting up HTTP file-sharing server. Unfortunately it does not natively provide RSS feeds that would be perfect for notifications about new files available for download.
After some poking and bugging fellow HFS users and developer himself last year I had put together usable workaround.
File list
HFS has native support for file lists. It outputs nice pack of URLs that is easy to feed to download managers instead of clicking each file.
Add some XML markup to that list and we have ourselves RSS feed.
File list template
Create text file named filelist.tpl in same directory as HFS executable and paste following code in it:
<?xml version="1.0" ?>
<rss version="2.0">
<channel>
<title>%host%%folder% directory feed</title>
<description>Files in %host%%folder% directory</description>
<link>http://%host%</link>
%files%
</channel>
</rss>
[files]
%list%
[file]
<item>
<title><![CDATA[%item-name%]]></title>
<description><![CDATA[%item-name% (%item-size%)]]></description>
<guid><![CDATA[http://%host%%folder%%item-url%]]></guid>
</item>
Browser discovery
File list is replaced with RSS feed and it should be obvious as such.
Menu > Edit HTML template…
Insert following line right before </head> and press Ok.
<link rel=”alternate” type=”application/rss+xml” title=”RSS for folder” href=”http://%host%%folder%~files.lst?recursive” />
Now browsers that support feed discovery will show available RSS feed in each folder. File list link that is shown on page can also be renamed (or removed).
Limitations
Feed is served as plain text instead of XML – should not be a problem but may limit compatibility with some readers; no timestamps on RSS items because of complex time format used, currently impossible to replicate it in HFS; some characters (square brackets for example) are not properly encoded; resulting RSS includes all files instead of few recent ones, no workaround because of way sorting in HFS works.Overall
Method is far from perfect but is easy to implement and doesn’t require additional software. Definitely beats constant explaining why I had deleted something before someone had seen it.
No comments:
Post a Comment