View Single Post
Old 2004-03-14, 09:07   Link #14
GHDpro
Administrator
*Administrator
 
 
Join Date: Jan 2001
Location: Netherlands
Age: 45
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