AnimeSuki Forums

Register Forum Rules FAQ Members List Social Groups Search Today's Posts Mark Forums Read

Go Back   AnimeSuki Forum > General > Forum & Site Feedback

Reply
 
Thread Tools
Old 2003-11-15, 20:42   Link #1
NightWish
Crushcrushcrush
*AnimeSuki Site Staff
*Moderator
 
 
Join Date: Mar 2003
Age: 34
Post AnimeSuki RSS & XML

Please Note: This information was originally posted by GHDpro on the old forum, here.

XML
For those of you who wish to syndicate the latest releases
(essentially the main page), by request I've written a XML
page to make extracting the info a lot easier (hopefully).

The page is: http://www.animesuki.com/xml.php

By default it outputs exactly the same thing as the main
page, sorted by added date. But there are a few options:

type=releases
This sorts the XML page by release date, not added date.

sortname=1
This sorts the page by filename if specified.

cutoff=Unix Timestamp
Allows you to specify how much you want to see. The value
you need to pass to this is a unix timestamp. Any torrents older
(by added or release date) than this date will not be included
in the output, hence the name "cutoff". So if you just want
the releases of the past day, you would specify:
time() - (24 * 60 * 60)
Note: The maximum cutoff is about 10 days, anything more
will not be allowed because it would use to much bandwidth if
used to much with that amount of data.


Example URL using above options:
http://www.animesuki.com/xml.php?type=releases&sortname=1&cutoff=1000000

Now I've not written any XML before, so I'm not sure if the
page can even be properly parsed at all, but IMHO it looks good.

RSS
After more requests (see below) I've now also build a RSS page.
Looking into what client applications can do with such a feed,
RSS looks VERY interesting.

The page is: http://www.animesuki.com/rss.php

One client you can use for this feed is FeedReader (Freeware).
One very interesting option of this utility is that it can sit in the
system tray and check the RSS page in intervals (15 min by default).
If it finds a new "headline", it'll show a popup like this:
http://www.feedreader.com/images/fr7.jpg

Imagine getting notified of the latest Naruto (or whatever your
favorite series is) this way! I haven't really tested it properly,
but in theory it should work!
(Many people have since tested it ^_^ and it does indeed work really well ~ Ed)

Note: The RSS page doesn't take any options, it always lists the most
recent added torrents in the past 24 hours.


--

If you have any questions/comments, reply to this thread.

Last edited by NightWish; 2004-12-31 at 14:37.
NightWish is offline   Reply With Quote
Old 2003-11-21, 22:49   Link #2
Shii
Afflicted by the vanities
*Fansubber
 
 
Join Date: Feb 2003
Location: Fish-shape Paumanok
Age: 26


You can also use the RSS to put an AnimeSuki feed on your homepage. Using a tool like http://www.newsisfree.com/ you can see the latest headlines from Slashdot, Kuro5hin and AnimeSuki all in one place.
__________________
Learn to define and spell moé
Shii (formerly known as ashibaka)
Shii is offline   Reply With Quote
Old 2003-12-04, 21:39   Link #3
Green˛
It's Magic
 
 
Join Date: Nov 2003
Location: Up and to the Left
Age: 33


I'm currently using Desktop Sidebar for the RSS feed. Screenshot (75KB).
Green˛ is offline   Reply With Quote
Old 2004-03-12, 14:15   Link #4
phattangent
Junior Member
 
Join Date: Dec 2003
I've been playing around with the XML (not RSS XML) and have successfully parsed it using php.... http://temp.pzfn.com/xmlsuki/
the filesize might be off but is approximate and i can't figure out why the release dates comeout wrong... maybe because server time is different or something...
phattangent is offline   Reply With Quote
Old 2004-03-12, 14:30   Link #5
Forse
r00t for life
 
Join Date: Jun 2003
Location: /dev/null
Quote:
Originally Posted by phattangent
I've been playing around with the XML (not RSS XML) and have successfully parsed it using php.... http://temp.pzfn.com/xmlsuki/
the filesize might be off but is approximate and i can't figure out why the release dates comeout wrong... maybe because server time is different or something...
I have done similar thing, but my script works a little better http://www.animeblitz.org/Temp/asripper/example.php
__________________
Forse is offline   Reply With Quote
Old 2004-03-12, 14:39   Link #6
NightWish
Crushcrushcrush
*AnimeSuki Site Staff
*Moderator
 
 
Join Date: Mar 2003
Age: 34
Exclamation

Even though your page looks nicer and has all the presented information on it I think phattangent's attempt is better. Given the name of your file (asripper) and the fact it shows only Naruto torrents; I'm guessing you just filtered the Naruto series page. He on the other hand processed the XML feed as intended... So in my opinion, despite your pretty layout, his is the "better" page in this instance.

Anyway; back on topic -- I'm not really sure why you posted in this thread phattangent; if you want help with the script (fixing the time for example?) you might want to post in the Technology forum instead.
__________________
Lay down on the ground, and let the tears run from you, crying to the grass and trees and heaven, finally on your knees; Let me live again…
NightWish is offline   Reply With Quote
Old 2004-03-12, 14:47   Link #7
Forse
r00t for life
 
Join Date: Jun 2003
Location: /dev/null
Quote:
Originally Posted by NightWish
Even though your page looks nicer and has all the presented information on it I think phattangent's attempt is better. Given the name of your file (asripper) and the fact it shows only Naruto torrents; I'm guessing you just filtered the Naruto series page. He on the other hand processed the XML feed as intended... So in my opinion, despite your pretty layout, his is the "better" page in this instance.
I just want to respond to your comment. Anyway script can be passed id of any series so any series stats work. Second it uses agressive caching and load faster (mySQL)...both do the same thing in the end.

Edit: Just changed id to "one piece" to show it works with any series. Plus it uses css to change look and one another thing...AS doesn't provide xml for series, if it did I would parse xml rather too.
__________________
Forse is offline   Reply With Quote
Old 2004-03-12, 17:08   Link #8
phattangent
Junior Member
 
Join Date: Dec 2003
I can't seem to get http://www.animeblitz.org/Temp/asripper/example.php to show up...

note: i thought about exporting the xml to mysql but then realized that the ul and dl wouldn't be live for torrents not in the xml...

note2: i think that maybe instead of getting animesuki's xml file every hit it might be better to do a cron job and get the xml once every hour or two and save it to a local suki.xml (maybe) and then run my script using that.. which probably would be faster

Oh yeah... i fixed the release dates....

Last edited by phattangent; 2004-03-12 at 17:10. Reason: need to add tht i fixed the time in my script
phattangent is offline   Reply With Quote
Old 2004-03-12, 17:36   Link #9
Forse
r00t for life
 
Join Date: Jun 2003
Location: /dev/null
Quote:
Originally Posted by phattangent
I can't seem to get url to show up...

note: i thought about exporting the xml to mysql but then realized that the ul and dl wouldn't be live for torrents not in the xml...

note2: i think that maybe instead of getting animesuki's xml file every hit it might be better to do a cron job and get the xml once every hour or two and save it to a local suki.xml (maybe) and then run my script using that.. which probably would be faster

Oh yeah... i fixed the release dates....
Site is up alright. Try this: http://213.139.167.217/Temp/asripper/example.php. Anyway when I was making script I considered many things...my script is aware of mirrors and doesn't hit one mirror all the time. It caches stats in mysql table (every x seconds). I tried to make it as easy as possible to use, already some sites use it without problems. Also when scripts leeches files off as server it shows up as normal MSIE user =)
__________________
Forse is offline   Reply With Quote
Old 2004-03-12, 17:53   Link #10
phattangent
Junior Member
 
Join Date: Dec 2003
ok... i can see it now... thats cool.... is it possible for me to see your code?
phattangent is offline   Reply With Quote
Old 2004-03-12, 18:02   Link #11
Forse
r00t for life
 
Join Date: Jun 2003
Location: /dev/null
Quote:
Originally Posted by phattangent
ok... i can see it now... thats cool.... is it possible for me to see your code?
Sure on one condition...if you make it better/tweak/change post me a copy =)

PM sent
__________________
Forse is offline   Reply With Quote
Old 2004-03-12, 18:07   Link #12
phattangent
Junior Member
 
Join Date: Dec 2003
sure thing... thx!
phattangent is offline   Reply With Quote
Old 2004-03-13, 20:20   Link #13
AOforever1
Senior Member
 
 
Join Date: Jan 2004
Location: USA
Age: 26
Send a message via AIM to AOforever1 Send a message via MSN to AOforever1
First off, Moin Forse! ^_^

I just recently (like a few hours ago) read about RSS in the April edition of Maxium PC and I started thinking about posting a comment about this on the forums. And low and behold, people have already done it LOL.

So anyways back to the topic.

I'm confused Forse on why you are using PHP to check AS releases when the XML/RSS is all ready and there for you to use?

What's the advantage? Cause I want to start scripting my own page =P
__________________
AOforever1 is offline   Reply With Quote
Old 2004-03-14, 09:07   Link #14
GHDpro
Administrator
*AnimeSuki Site Staff
*Moderator
 
 
Join Date: Jan 2001
Location: Netherlands
Age: 35
Let me show a trick so far only reserved for the innards of the AnimeSuki (mirror-side) scripts:

http://www.rpguru.com/data/scrape.dat

This file contains a repeating pattern of 6 bytes containing:
- UL
- DL
- Penalties for the tracker

Special values: 65535 for penalties means "no info for UL/DL" (the site will show "-" instead).

Here is the function you can use to get the info
(where $scrape is a string with complete contents of the file):
[php]function Scrape($torrentid)
{
global $scrape;
return unpack("nul/ndl/npenalties",substr($scrape,($torrentid-1)*6,6));
}[/php]
This will return an array with the fields array["ul"], array["dl"] and array["penalties"].

Now just like RSS and XML, please DO NOT hit this file to often, and DO NOT
use the main site (AnimeSuki.com) to get this info -- use mirrors and preferbly
the link I posted above, as it's my "own" mirror which can take a "hit" (by figure
of speech).

PS:
There are more data files like these, but those aren't as useful. Most of the data
is stored in a MySQL database of course, as it's easier to query on. However the
scrape (UL/DL) etc. data would be much to "tiny" to update the database with each
time for each row -- it would take thousands of UPDATE queries -- every 15 minutes!
Which is still ok for a server you own (backend server does do this) but I wouldn't want
to burden the mirrors with this and came up with this solution.
GHDpro is offline   Reply With Quote
Old 2004-03-15, 02:05   Link #15
AOforever1
Senior Member
 
 
Join Date: Jan 2004
Location: USA
Age: 26
Send a message via AIM to AOforever1 Send a message via MSN to AOforever1
So I would use the PHP function you provided to grab info from that .dat file you provided?

That's it?
__________________
AOforever1 is offline   Reply With Quote
Old 2004-03-15, 03:32   Link #16
NightWish
Crushcrushcrush
*AnimeSuki Site Staff
*Moderator
 
 
Join Date: Mar 2003
Age: 34
Yes and no. That function will extract the information from a string called $scrape but it would be up to you to actually download the .dat file from one of the mirrors and read it into the string.
__________________
Lay down on the ground, and let the tears run from you, crying to the grass and trees and heaven, finally on your knees; Let me live again…
NightWish is offline   Reply With Quote
Old 2004-03-15, 03:34   Link #17
GHDpro
Administrator
*AnimeSuki Site Staff
*Moderator
 
 
Join Date: Jan 2001
Location: Netherlands
Age: 35
...and to elaborate on NighWish's post, that would be as simple as:
[php]$fp = fopen("http://www.rpguru.com/data/scrape.dat","rb");
if ($fp)
{
$scrape = fread($fp,102400);
fclose($fp);
}[/php]
...really simple PHP -- if you don't know that then... er. Of course you can
make it a bit more exotic if you use the CURL functionality in PHP (if compiled in)
to get the file (which is what the AnimeSuki scripts do to for example support
GZIP reading etc, which some trackers require).
GHDpro is offline   Reply With Quote
Old 2004-03-15, 04:36   Link #18
Forse
r00t for life
 
Join Date: Jun 2003
Location: /dev/null
Quote:
Originally Posted by AOforever1
I'm confused Forse on why you are using PHP to check AS releases when the XML/RSS is all ready and there for you to use?
Grrr...AS doesn't provide xml/rss for series.

P.S. I would rather use xml too if there was one for series.
__________________
Forse is offline   Reply With Quote
Old 2004-03-15, 07:27   Link #19
phattangent
Junior Member
 
Join Date: Dec 2003
Quote:
Originally Posted by Forse
Grrr...AS doesn't provide xml/rss for series.

P.S. I would rather use xml too if there was one for series.
yup yup...

------------------------------

Here is an example of how my xml parser script will look on my website...
http://temp.pzfn.com/?bittorrent
phattangent is offline   Reply With Quote
Old 2004-03-15, 17:37   Link #20
AOforever1
Senior Member
 
 
Join Date: Jan 2004
Location: USA
Age: 26
Send a message via AIM to AOforever1 Send a message via MSN to AOforever1
Quote:
Originally Posted by Forse
Grrr...AS doesn't provide xml/rss for series.

P.S. I would rather use xml too if there was one for series.
Ahhh sry, I was kinda slow there xD

thx for sharing the info guys.
I'll be able to take it from here, I'm taking a C++ class now and im the top student :P
(yes, I love programing!)
__________________

Last edited by AOforever1; 2004-03-15 at 18:01.
AOforever1 is offline   Reply With Quote
Reply

Tags
animesuki suggestion, faq, feature request, wiki candidate

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:41.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
We use Silk.