AnimeSuki.com Forum

AnimeSuki Forum (http://forums.animesuki.com/index.php)
-   Forum & Site Feedback (http://forums.animesuki.com/forumdisplay.php?f=2)
-   -   AnimeSuki RSS & XML (http://forums.animesuki.com/showthread.php?t=1030)

NightWish 2003-11-15 20:42

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.

Shii 2003-11-21 22:49

:cool:

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.

Green² 2003-12-04 21:39

:bow:

I'm currently using Desktop Sidebar for the RSS feed. Screenshot (75KB).

phattangent 2004-03-12 14:15

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...

Forse 2004-03-12 14:30

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

NightWish 2004-03-12 14:39

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.

Forse 2004-03-12 14:47

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.

phattangent 2004-03-12 17:08

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....

Forse 2004-03-12 17:36

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 =)

phattangent 2004-03-12 17:53

ok... i can see it now... thats cool.... is it possible for me to see your code?

Forse 2004-03-12 18:02

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

phattangent 2004-03-12 18:07

sure thing... thx!

AOforever1 2004-03-13 20:20

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

GHDpro 2004-03-14 09:07

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.

AOforever1 2004-03-15 02:05

So I would use the PHP function you provided to grab info from that .dat file you provided?

That's it?

NightWish 2004-03-15 03:32

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.

GHDpro 2004-03-15 03:34

...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).

Forse 2004-03-15 04:36

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.

phattangent 2004-03-15 07:27

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

AOforever1 2004-03-15 17:37

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!)


All times are GMT -5. The time now is 19:58.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.