Created
August 14, 2011 09:56
-
-
Save whs/1144757 to your computer and use it in GitHub Desktop.
Tirkx new anime notifier
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $WANT = array( | |
| "65902", // Kami-sama no Memo-chou | |
| "68218", // Mayo Chiki! | |
| "50052", // Madoka Magica | |
| "53225", // Hidan no Aria | |
| "69900", // Mawaru Penguindrum | |
| "50459", // GOSICK | |
| "58315", // Steins;Gate | |
| ); | |
| header("Content-Type: text/plain"); | |
| /*$mem = new Memcache; | |
| $mem->connect('192.168.1.5', 11211); | |
| $tirk = $mem->get('tirkx');*/ | |
| //if(!$tirk){ | |
| $tirk = file_get_contents("http://main.tirkx.com/main/"); | |
| // $mem->set('tirkx', $tirk); | |
| //} | |
| $start = strpos($tirk, "THAI SUBTITLES"); | |
| $tirkscan = substr($tirk, $start, strpos($tirk, "OPs / EDs / OSTs") - $start); | |
| preg_match_all('~<a href="http://forum.tirkx.com/main/viewtopic\\.php\\?t=([0-9]+)">([^<]+)</a>~', $tirkscan, $out); | |
| $signature = trim(file_get_contents("tirkxlastload.txt")); | |
| $ns = sha1($out[2][0]); | |
| //print "Signature: ".$ns."\n"; | |
| //print "Last signature: ".$signature."\n"; | |
| foreach($out[1] as $k=>$v){ | |
| $name = $out[2][$k]; | |
| if(sha1($name) == $signature) break; | |
| if(in_array($v, $WANT)){ | |
| print "New anime release:\n"; | |
| print $name."\nhttp://forum.tirkx.com/main/viewtopic.php?t=".$v."\n\n"; | |
| } | |
| } | |
| file_put_contents("tirkxlastload.txt", $ns); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment