Family, Work, Life

RSS Torrent List from Onlinetvrecorder.com

January 5th, 2009 Ansi

Moin

Onlinetvrecorder disabled the good old RSS where I can get the list of my torrents of recorded movies. Unfortunatelly the new RSS link requires a session cookie what is not so easy with a bash script. Here is a small solution how to enable the automatic download of the RSS stream in order to download the feeds automatically.

First get an session cookie for www.onlinetvrecorder.com and store it into a local file.

wget \
    --save-cookies ~/.cookies/onlinetvrecorder \
    --keep-session-cookies \
    --post-data "email=name%40provider.com&pass=whatever&checkbox_remember=checkbox_remember&btn_login=Login&do=login" \
    -O - \
    http://www.onlinetvrecorder.com/index.php \
    > /dev/null

With this command you store the onlinetvrecorder session key to a file what you can use later on to download the RSS feed. “keep-session-cookies” are important because the key is only valid in the session. Replace “name”, “provider.com”  and “whatever” with your personal data. the “%40″ is url code for @.

wget -o /dev/null -O - --load-cookies ~/.cookies/onlinetvrecorder "http://www.onlinetvrecorder.com/rss/rss.php?hash=hashcode&userid=id"

Also replace “hashcode” and “id” with your personal data. You can see it in the browser when you check the RSS feed in your browser. Thats all. I think the uTorrent or other trackers can deal with a local file to parse. So just use a cronjob to store this file from time to time to local disc and let uTorrent do the rest. :-)

  • Share/Bookmark

Howto extract all followers from twitter into list of RSS feeds

July 24th, 2008 Ansi

I had this idea to use build a real distributed microblogger system a while ago. Unfortunately I was a little bit to late and twitter lost so many links between users (follow and followers) this night. But better now then never. I will post here from time to time parts of the pig picture how to build such a system. This time how to extract the list of friends from your Twitter account and generate a list of RSS feeds out of it.

Twitter has a cool API wich we can use legally. The xml list of users you follow can be retrieved with

http://twitter.com/statuses/friends/USERNAME.xml?lite=true&page=1..n (for me its ansi)

Having at the moment 112 user I follow (yesterday more then 160. :-( ) page 1 and 2 are all my guys.

This small xsl stylesheet extracts the userids. (if anyone is into xsl please help me here. Would be great to extract username, realname and user with comma separated per line. Please add comments if you know the solution, I appreciate it!)

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 <xsl:strip-space elements="*"/>

 <xsl:template match="/users/user">
     <xsl:for-each select="id">
      <xsl:value-of select="." />
      <xsl:text>&#10;</xsl:text>
     </xsl:for-each>
 </xsl:template>

Save this code snip to a file called extractIDs.xslt and call it with the processor:

xsltproc extractIDs.xslt friendsPage1.xml  | sed 1d >list_of_ids.txt
xsltproc extractIDs.xslt friendsPage2.xml  | sed 1d >>list_of_ids.txt

So now next step howto get the rss feeds out of it. The API offers this call

http://twitter.com/statuses/user_timeline/USERID.atom

Short bashscript like

 for i in `cat list_of_ids.txt`
 do
  echo "http://twitter.com/statuses/user_timeline/$i.atom" >>list_of_rrs_feeds.txt
 done

is doing the job. So we end up with a text file each line with one RSS feed. I totally agree its much easier at the moment to call the “user and friend” rss feed from twitter but the idea behind this is to get a list of each user so future systems can really be distributed among many microblogging systems.

  • Share/Bookmark