Files
wizzardRedux/sites/Tiddles.php

323 lines
6.1 KiB
PHP
Raw Normal View History

<?php
2016-02-26 11:57:34 -08:00
// Original code: The Wizard of DATz
2016-03-01 17:19:18 -08:00
// TODO: Investigate output (seems... odd)
print "<pre>";
2016-02-26 11:57:34 -08:00
$Versions = array('130810');
$Values = array();
foreach ($Versions as $Version)
{
2016-03-01 17:19:18 -08:00
$query = get_data("http://www.tiddles.org/s3c/customiser/?v=".$Version);
2016-02-26 11:57:34 -08:00
$query = explode('<form ', $query);
$query = explode('<input ', $query[1]);
foreach ($query as $row)
{
$id = explode(' id="', $row);
$id = explode('"', $id[1]);
$id = $id[0];
$name = explode(' name="', $row);
$name = explode('"',$name[1]);
$name = $name[0];
$value = explode(' value="', $row);
$value = explode('"', $value[1]);
$value = $value[0];
if ($name)
{
$Values[$name][$id] = $value;
}
}
}
print_r($Values);
2016-02-26 11:57:34 -08:00
$Valueskeys = array_keys($Values);
2016-03-01 17:19:18 -08:00
LoadKey('', 0);
2016-02-26 11:57:34 -08:00
function LoadKey($prev, $pos)
{
GLOBAL $Values, $Valueskeys;
2016-02-26 11:57:34 -08:00
if ($pos < count($Values))
{
for ($x = 0; $x < count($Values[$Valueskeys[$pos]]); $x++)
{
LoadKey($prev.$x, $pos + 1);
}
2016-02-26 11:57:34 -08:00
if (count($Values[$Valueskeys[$pos]] == 1))
{
LoadKey($prev.'1', $pos + 1);
}
2016-02-26 11:57:34 -08:00
}
else
{
print $prev."\n";
}
}
2016-02-26 11:57:34 -08:00
/*
$dirs=array();
2016-02-26 11:57:34 -08:00
$max = 100000;
2016-02-26 11:57:34 -08:00
for ($pagetype = 0; $pagetype < 2; $pagetype++)
{
for ($page = 1; $page < $max; $page++)
{
$dir = "http://zxaaa.untergrund.net/view_demos.php?t=".$pagetype."&np=".$page;
print "load: ".$dir."\n";
2016-03-01 17:19:18 -08:00
$query = get_data($dir));
2016-02-26 11:57:34 -08:00
$query = explode(' <tr', $query);
array_splice($query, 0, 1);
2016-02-26 11:57:34 -08:00
$new = 0;
$old = 0;
2016-02-26 11:57:34 -08:00
$notFound = true;
2016-02-26 11:57:34 -08:00
foreach ($query as $row)
{
$row = explode('<td', $row);
$title = trim(strip_tags('<td'.$row[1]));
2016-02-26 11:57:34 -08:00
$info = array();
2016-02-26 11:57:34 -08:00
for ($x = 4; $x < 9; $x++)
{
2016-02-26 11:57:34 -08:00
$temp = trim(strip_tags('<td'.$row[$x]));
if ($temp)
{
$info[] = $temp;
}
}
2016-02-26 11:57:34 -08:00
if ($info)
{
$title = $title." (".implode(") (", $info).")";
}
2016-02-26 11:57:34 -08:00
$DLs = explode('get.php?f=', $row[1]);
array_splice($DLs, 0, 1);
2016-02-26 11:57:34 -08:00
foreach ($DLs as $DL)
{
$DL = explode('"', $DL);
$DL = $DL[0];
2016-02-26 11:57:34 -08:00
$ext = explode('.', $DL);
$ext = $ext[count($ext) - 1];
2016-02-26 11:57:34 -08:00
if (!$r_query[$DL])
{
2016-02-26 11:57:34 -08:00
$found[] = array($title.".".$ext, $DL);
$new++;
2016-02-26 11:57:34 -08:00
$r_query[$DL] = true;
}
else
{
$old++;
}
2016-02-26 11:57:34 -08:00
$notFound = false;
}
}
2016-02-26 11:57:34 -08:00
if ($notFound)
{
$page = $max;
}
print "new: ".$new.", old: ".$old."\n";
}
}
2016-02-26 11:57:34 -08:00
$dirs = array(
'http://zxaaa.untergrund.net/DEMA.html',
'http://zxaaa.untergrund.net/INTRA.html',
);
2016-02-26 11:57:34 -08:00
$dirsb = array(
array('intbis1998.html','BIS From Rush'),
array('intbis1999.html','BIS From Rush'),
array('intbis2000.html','BIS From Rush'),
array('intbis2001.html','BIS From Rush'),
array('intbis2002.html','BIS From Rush'),
array('intbis2003.html','BIS From Rush'),
array('intbis2004.html','BIS From Rush'),
array('intbis2005.html','BIS From Rush'),
array('intbis2006.html','BIS From Rush'),
array('intbis2007.html','BIS From Rush'),
array('sgteam2007.html','SG-Team'),
array('sgteam2008.html','SG-Team'),
array('sgteam2009.html','SG-Team'),
array('sgteam2010.html','SG-Team'),
array('sgteam2011.html','SG-Team'),
array('sgteam2012.html','SG-Team'),
array('STARYO.html','Diski Staryo',true),
array('DISKAAA.html','Disk Colection\'s AAA',true),
array('DISKAAA2.html','Disk Colection\'s AAA',true),
array('DISKAAA3.html','Disk Colection\'s AAA',true),
array('DISKAAA4.html','Disk Colection\'s AAA',true),
array('DISALON.html','Wlodek',true),
array('IRONDISK.html','Iron',true),
array('ZXCHIP.html','ZX CHIP',true),
array('ZXCHIP2.html','ZX CHIP',true),
array('FICUS.html','Ficus Demo Collections',true),
array('FICUS2.html','Ficus Demo Collections',true),
array('FICUSG.html','Flash Inc Games Collections',true),
array('FICUSG2.html','Flash Inc Games Collections',true),
array('flashrelize.html','Flash Inc Relize',true),
array('MAGICSOFTSYS.html','',true),
);
2016-02-26 11:57:34 -08:00
foreach ($dirs as $dir)
{
print "load: ".$dir."\n";
2016-03-01 17:19:18 -08:00
$query = get_data($dir));
2016-02-26 11:57:34 -08:00
$query = explode('<td><a href="', $query);
array_splice($query, 0, 1);
2016-02-26 11:57:34 -08:00
foreach ($query as $row)
{
$row = explode('"', $row);
if ($row[6])
{
$dirsb[] = array($row[0], $row[6]);
}
}
}
2016-02-26 11:57:34 -08:00
foreach ($dirsb as $dir)
{
$cdir = "http://zxaaa.untergrund.net/".$dir[0];
print "load: ".$cdir."\n";
2016-02-26 11:57:34 -08:00
$new = 0;
$old = 0;
2016-03-01 17:19:18 -08:00
$query = get_data($cdir));
2016-02-26 11:57:34 -08:00
$query = str_replace("alt='", 'alt="', $query);
$query = str_replace("'>", '">', $query);
$query = explode('<a href="', $query);
array_splice($query, 0, 1);
2016-02-26 11:57:34 -08:00
foreach ($query as $row)
{
$DL = explode('"', $row);
$DL = $DL[0];
2016-02-26 11:57:34 -08:00
$title = explode('alt="', $row);
$title = explode('"', $title[1]);
$title = $title[0];
2016-02-26 11:57:34 -08:00
if ($title)
{
$ext = explode('.', $DL);
$ext = $ext[count($ext) - 1];
2016-02-26 11:57:34 -08:00
if ($dir[2])
{
$titel = $dir[1]." ".$title.".".$ext;
}
else
{
$titel = $title." (".$dir[1].").".$ext;
}
2016-02-26 11:57:34 -08:00
if (!$r_query[$DL])
{
2016-02-26 11:57:34 -08:00
$found[] = array($titel, $DL);
$new++;
2016-02-26 11:57:34 -08:00
$r_query[$DL] = true;
}
else
{
$old++;
}
}
}
print "new: ".$new.", old: ".$old."\n";
}
2016-02-26 11:57:34 -08:00
$dirsc = array();
2016-02-26 11:57:34 -08:00
$dir = "http://zxaaa.untergrund.net/GAME.html";
print "load: ".$dir."\n";
2016-03-01 17:19:18 -08:00
$query = get_data($dir));
2016-02-26 11:57:34 -08:00
$query = explode("<a href=\"javascript:jumpto('", $query);
array_splice($query, 0, 1);
2016-02-26 11:57:34 -08:00
foreach ($query as $row)
{
$row = explode("'", $row);
$dirsc[] = array($row[0], 'ZX Chip Volgodonsk Games Collections');
}
2016-02-26 11:57:34 -08:00
foreach ($dirsc as $dir)
{
$cdir = "http://zxaaa.untergrund.net/".$dir[0];
print "load: ".$cdir."\n";
2016-02-26 11:57:34 -08:00
$new = 0;
$old = 0;
2016-03-01 17:19:18 -08:00
$query = get_data($cdir));
2016-02-26 11:57:34 -08:00
$query = explode('<a href="', $query);
array_splice($query, 0, 1);
2016-02-26 11:57:34 -08:00
foreach ($query as $row)
{
$DL = explode('"', $row);
$DL = $DL[0];
2016-02-26 11:57:34 -08:00
$title = explode('>[', $row);
$title = explode(']<', $title[1]);
$title = $title[0];
2016-02-26 11:57:34 -08:00
if ($title)
{
$ext = explode('.', $DL);
$ext = $ext[count($ext) - 1];
2016-02-26 11:57:34 -08:00
$titel = $dir[1]." ".$title.".".$ext;
2016-02-26 11:57:34 -08:00
if (!$r_query[$DL])
{
2016-02-26 11:57:34 -08:00
$found[] = array($titel, $DL);
$new++;
2016-02-26 11:57:34 -08:00
$r_query[$DL] = true;
}
else
{
$old++;
}
}
}
print "new: ".$new.", old: ".$old."\n";
}
print "\nnew urls:\n\n";
print "<table><tr><td><pre>";
2016-02-26 11:57:34 -08:00
foreach ($found as $url)
{
print $url[1]."\n";
}
print "</td><td><pre>";
2016-02-26 11:57:34 -08:00
foreach ($found as $url)
{
print "<a href=\"http://zxaaa.untergrund.net/".$url[1]."\">".$url[0]."</a>\n";
}
print "</td></tr></table>";
*/
?>