<?php
require("ii-functions.php");
$cfg=[
"noauth",
"http://spline.rooker.ru/ii/ii-point.php?q=/",
"spline.creepy.14",
"spline.openbsd-cvs.rss.14",
"ru.humor.14",
"ii.whoami.2014",
"ii.about.14",
"ii.test.14",
"ii.dev.14",
"spline.bash.rss.14",
"spline.lor.rss.14",
"anekdot.im.2014",
"im.1406"
];
//$cfg=[
// "no auth",
// "http://51t.ru/",
// "im.1404",
// "ii.dev.14",
// "ii.announce.14",
// "ii.test.14",
// "anekdot.im.2014",
// "rw.51",
// "vote.2014",
// "about.users.51",
// "bug.14",
// "to.doc.14"
//];
function getf($l) {
echo "fetch $l\n";
return file_get_contents($l);
}
function get_echoarea($name) {
if(!file_exists("echo/".$name)) {
touch("echo/".$name);
return [];
} else {
return explode("\n", file_get_contents("echo/".$name));
}
}
function sep($l, $step=20) {
for($x=0;$x<count($l);$x+=$step) {
yield array_slice($l,$x,$x+$step);
}
}
function debundle($ea,$s) {
foreach(explode("\n",$s) as $n) {
$arr = explode(':',$n,2);
$mid=$arr[0]; $kod=$arr[1];
if ($mid!=="\n" & $mid !== "") {
file_put_contents('msg/'.$mid, b64d($kod));
file_put_contents('echo/'.$ea, $mid."\n", FILE_APPEND);
}
}
}
function walk_el($out) {
$ea = ''; $el = [];
foreach(explode("\n", $out) as $n) {
if (substr_count($n, ".")>0) {
$ea = $n;
$el[$ea] = [];
}
elseif($ea) {
$el[$ea][]=$n;
}
}
return $el;
}
function parse() {
global $cfg;
$out = getf($cfg[1]."u/e/".implode("/", array_slice($cfg, 2)));
$el = walk_el($out);
foreach(array_slice($cfg, 2) as $ea) {
$myel = array_unique(get_echoarea($ea));
$dllist=[];
foreach($el[$ea] as $x) {
$search=array_search($x, $myel);
$len=count($myel);
if((!$search && $search!==0) xor (count($el[$ea])==1)) {
$dllist[]=$x;
}
}
foreach(sep($dllist,40) as $dl) {
$s = getf($cfg[1]."u/m/".implode("/",$dl));
debundle($ea,$s);
}
}
}
parse();
?>
Только гейтлист не забудь поменять