From 2df2fc0e49dbb01aaecf00cfe3076e2f1b3f168d Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 26 Feb 2016 12:48:32 -0800 Subject: [PATCH] Nearing the end of round 1 --- wizzardRedux/admin/onlinecheck.php | 12 +- wizzardRedux/sites/TZXvault.php | 199 +-- wizzardRedux/sites/UltimateC64TP.php | 112 +- wizzardRedux/sites/UnofficialCD32Ports.php | 74 +- wizzardRedux/sites/VideopacNL.php | 1338 ++++++++++---------- wizzardRedux/sites/VimmsLair.php | 164 +-- wizzardRedux/sites/vgdb.php | 79 +- wizzardRedux/sites/vic20it.php | 165 ++- 8 files changed, 1097 insertions(+), 1046 deletions(-) diff --git a/wizzardRedux/admin/onlinecheck.php b/wizzardRedux/admin/onlinecheck.php index 9fc0546..71df4aa 100644 --- a/wizzardRedux/admin/onlinecheck.php +++ b/wizzardRedux/admin/onlinecheck.php @@ -6,8 +6,7 @@ Check for new downloadable ROMs from all available sites Requires: source The sourcename to check against (in sites/.php) -TODO: Retool existing onlinecheck.php files to follow the new format - 2 passes: 1) reformat file and categorize, 2) check code flow to try to optimize +TODO: Retool existing onlinecheck.php files to follow the new format. 2 passes: 1) reformat file and categorize, 2) check code flow to try to optimize TODO: Add a way to figure out if a site is dead based on the original list that WoD created TODO: Most explode/implode can probably be changed to preg_match, just need to decipher them TODO: For page read, can we use the function in parsenointro (the cURL one)? @@ -20,6 +19,8 @@ TODO: Remove external and import only TODO: Merge MESS and MAME in sources TODO: Some loadDir functions are useless because they are only used once. Put their code where it should be TODO: Maybe look at NES-CartDatabase for No-Intro parsing +TODO: VideopacNL uses a cookie to be able to access the board. This means you need to log in to the site and then copy the cookie as a param +TODO: VimmsLair uses wget.exe currently. Can this be reamped to use cURL instead (since it's built into PHP)? */ // Site whose checkers have been once-overed (not all checked for dead) @@ -132,6 +133,13 @@ $checked = array ( "tosec", // Import only "TRS80CoCoArchive", "trurip", // Import only + "TZXvault", + "UltimateC64TP", + "UnofficialCD32Ports", + "vgdb", + "vic20it", + "VideopacNL", + "VimmsLair", ); if (!isset($_GET["source"])) diff --git a/wizzardRedux/sites/TZXvault.php b/wizzardRedux/sites/TZXvault.php index 1a8cde5..487f483 100644 --- a/wizzardRedux/sites/TZXvault.php +++ b/wizzardRedux/sites/TZXvault.php @@ -1,9 +1,8 @@ "; - $r_query=implode ('', file ($_GET["source"]."/ids.txt")); - $r_query=explode ("\r\n","\r\n".$r_query); - $r_query=array_flip($r_query); +// Original code: The Wizard of DATz + +print "
";
 
 $mainPages=Array(
 	"http://www.tzxvault.org/index.htm",
@@ -13,110 +12,134 @@ $mainPages=Array(
 	"http://www.tzxvault.org/Vic20/index.htm",
 );
 
-$pages=Array();
+$pages = array();
 
 foreach ($mainPages as $page)
 {
 	print "load ".$page."\n";
-	$content=implode ('', file ($page));
-	$content=explode ('href="',$content);
-	array_splice ($content,0,1);
+	$content = implode('', file($page));
+	$content = explode('href="', $content);
+	array_splice($content, 0, 1);
 
-	foreach ($content as $row){
-		$row=explode('"',$row);
-		$row=$row[0];
+	foreach ($content as $row)
+	{
+		$row = explode('"', $row);
+		$row = $row[0];
 		print "found ".$row."\n";
-		$pages[$row]=$row;
+		$pages[$row] = $row;
 	}
 }
 
-$URLs=Array();
-
 foreach ($pages as $page)
 {
 	print "load ".$page."\n";
 
-	$dirs=Array();
+	$dirs = array();
 
-	$new=0;
-	$old=0;
+	$new = 0;
+	$old = 0;
 
-	$content=implode ('', file ($page));
-	$content=str_replace(' ',' ', $content);
+	$content = implode('', file($page));
+	$content = str_replace(' ', ' ', $content);
 
-	$content2=explode ('',$content);
-	$content2[0]=null;
+	$content2 = explode('', $content);
+	$content2[0] = null;
 
-	$content=explode ('1)
+			if (count($ext) > 1)
 			{
-				$name=explode ('',$row);
-				$name=strip_tags($name[0]);
-				$name=explode ('>',$name);
-				$name=trim($name[1]);
+				$name = explode('', $row);
+				$name = strip_tags($name[0]);
+				$name = explode('>', $name);
+				$name = trim($name[1]);
 
-				$addinf=explode ('',$row);
-				$publ=explode ('',$addinf[1]);
-				$publ=trim(strip_tags($publ[0]));
-				if($publ)$name=$name." (".$publ.")";
-				$year=explode ('',$addinf[2]);
-				$year=trim(strip_tags($year[0]));
-				if($year)$name=$name." (".$year.")";
-
-				$url_split=explode('/',$url);
-
-				if($name){
-					$name=$name.".".$ext[count($ext)-1];
-				}else{
-					$name=$url_split[count($url_split)-1];
+				$addinf = explode('', $row);
+				$publ = explode('', $addinf[1]);
+				$publ = trim(strip_tags($publ[0]));
+				if ($publ)
+				{
+					$name = $name." (".$publ.")";
+				}
+				$year = explode('', $addinf[2]);
+				$year = trim(strip_tags($year[0]));
+				if ($year)
+				{
+					$name = $name." (".$year.")";
 				}
 
-				$url_split[count($url_split)-1]=null;
-				$url_split=implode('/',$url_split);
-				
-				$dirs[$url_split]=$url_split;
+				$url_split = explode('/', $url);
 
-				if(!$r_query[$url])	{
-					$URLs[]=Array($url,$name);
+				if ($name)
+				{
+					$name = $name.".".$ext[count($ext) - 1];
+				}
+				else
+				{
+					$name = $url_split[count($url_split) - 1];
+				}
+
+				$url_split[count($url_split) - 1] = null;
+				$url_split = implode('/', $url_split);
+				
+				$dirs[$url_split] = $url_split;
+
+				if (!$r_query[$url])
+				{
+					$found[] = array($url, $name);
 					$new++;
-					$r_query[$url]=true;
-				} else {
+					$r_query[$url] = true;
+				}
+				else
+				{
 					$old++;
 				}
 			}
 		}
 	}
 
-	foreach($content2 as $row){
-		if($row){
-			$name=explode ('',$row);
-			$name=$name[0];
-			$file=str_replace(' ','',$name).".zip";
+	foreach ($content2 as $row)
+	{
+		if ($row)
+		{
+			$name = explode('', $row);
+			$name = $name[0];
+			$file = str_replace(' ', '', $name).".zip";
 
-			$addinf=explode ('',$row);
-			$publ=explode ('',$addinf[1]);
-			$publ=trim(strip_tags($publ[0]));
-			if($publ)$name=$name." (".$publ.")";
-			$year=explode ('',$addinf[2]);
-			$year=trim(strip_tags($year[0]));
-			if($year)$name=$name." (".$year.")";
+			$addinf = explode('', $row);
+			$publ = explode('', $addinf[1]);
+			$publ = trim(strip_tags($publ[0]));
+			if ($publ)
+			{
+				$name = $name." (".$publ.")";
+			}
+			$year = explode('', $addinf[2]);
+			$year = trim(strip_tags($year[0]));
+			if ($year)
+			{
+				$name = $name." (".$year.")";
+			}
 
 			foreach($dirs as $dir)
 			{
-				$url=$dir.$file;
-				if(!$r_query[$url])	{
-					$URLs[]=Array($url,$name.".zip");
+				$url = $dir.$file;
+				if (!$r_query[$url])
+				{
+					$found[] = array($url, $name.".zip");
 					$new++;
-					$r_query[$url]=true;
-				} else {
+					$r_query[$url] = true;
+				}
+				else
+				{
 					$old++;
 				}
 			}
@@ -125,21 +148,21 @@ foreach ($pages as $page)
 
 	print "found new ".$new.", old ".$old."\n";
 }
-	sort($URLs);
+sort($found);
 
-	print "
";
-	
-	foreach($URLs as $row)
-	{
-		print $row[0]."\n";
-	}
-	
-	print "
";
-	
-	foreach($URLs as $row)
-	{
-		print "".$row[1]."\n";
-	}
-	
-	print "
"; +print "
";
+
+foreach ($found as $row)
+{
+	print $row[0]."\n";
+}
+
+print "
";
+
+foreach ($found as $row)
+{
+	print "".$row[1]."\n";
+}
+
+print "
"; ?> \ No newline at end of file diff --git a/wizzardRedux/sites/UltimateC64TP.php b/wizzardRedux/sites/UltimateC64TP.php index 09ddd36..2d93db0 100644 --- a/wizzardRedux/sites/UltimateC64TP.php +++ b/wizzardRedux/sites/UltimateC64TP.php @@ -1,68 +1,80 @@ "; - $r_query=implode ('', file ($_GET["source"]."/ids.txt")); - $r_query=explode ("\r\n",$r_query); - $r_query=array_flip($r_query); +$page="http://tapes.c64.no/main_tapelist.php?group=all&orderby=title"; - $page="http://tapes.c64.no/main_tapelist.php?group=all&orderby=title"; +print "load ".$page."\n"; - print "load ".$page."\n"; +$content=implode ('', file ($page)); +$content=explode ('',$content); +$content=explode ('',$content); - $content=explode ('', $row); - $new=0; - $old=0; + $id = explode("',$row); + $info = array(); + $temp = trim(strip_tags($row[3])); + if ($temp) + { + $info[] = $temp; + } + $temp = trim(strip_tags($row[2])); + if ($temp) + { + $info[] = $temp; + } + $temp = trim(strip_tags($row[5])); + if ($temp) + { + $info[] = $temp; + } - $id=explode ("
";
-	
-	foreach($URLs as $row)
-	{
-		print $row[0]."\n";
-	}
-	
-	print "
";
-	
-	foreach($URLs as $row)
-	{
-		print "".$row[1]."\n";
-	}
-	
-	print "
"; +print "
";
+
+foreach ($found as $row)
+{
+	print $row[0]."\n";
+}
+
+print "
";
+
+foreach ($found as $row)
+{
+	print "".$row[1]."\n";
+}
+
+print "
"; ?> \ No newline at end of file diff --git a/wizzardRedux/sites/UnofficialCD32Ports.php b/wizzardRedux/sites/UnofficialCD32Ports.php index 5d95056..51affad 100644 --- a/wizzardRedux/sites/UnofficialCD32Ports.php +++ b/wizzardRedux/sites/UnofficialCD32Ports.php @@ -1,53 +1,53 @@ "; - $r_query=implode ('', file ($_GET["source"]."/ids.txt")); - $r_query=explode ("\r\n","\r\n".$r_query); - $r_query=array_flip($r_query); +$new = 0; +$old = 0; - $URL_Array=array(); - - $new=0; - $old=0; - - $query=implode ('', file ("http://unofficial-cd32-ports.blogspot.co.nz/search?max-results=100")); - $query=explode("

\n",$row); - $title=explode(">",$title[0]); - $title=$title[1]; - if(!$r_query[$url]) - { - $URL_Array[]=Array($url,$title); - $new++; - } else { - $old++; - } +$query = implode('', file("http://unofficial-cd32-ports.blogspot.co.nz/search?max-results=100")); +$query = explode("

\n", $row); + $title = explode(">", $title[0]); + $title = $title[1]; + if (!$r_query[$url]) + { + $found[] = array($url, $title); + $new++; + } + else + { + $old++; } } +} - print "found new ".$new.", old ".$old."\n"; +print "found new ".$new.", old ".$old."\n"; - print "
";
+print "
";
 
-	foreach($URL_Array as $row)
-	{
-		print "".$row[1]."\n";
-	}
+foreach ($found as $row)
+{
+	print "".$row[1]."\n";
+}
 
-	print "
";
+print "
";
 
-	foreach($URL_Array as $row)
-	{
-		print "".$row[0]."\n";
-	}
+foreach ($found as $row)
+{
+	print "".$row[0]."\n";
+}
 
-	print "
"; +print "
"; ?> \ No newline at end of file diff --git a/wizzardRedux/sites/VideopacNL.php b/wizzardRedux/sites/VideopacNL.php index 35cb21f..89de906 100644 --- a/wizzardRedux/sites/VideopacNL.php +++ b/wizzardRedux/sites/VideopacNL.php @@ -1,6 +1,566 @@ "; + + $queryb = getHTML1("http://videopac.nl/forum/index.php", $_GET["cookie"]); + $queryb = explode('WoD',$queryb); + + if ($queryb[1]) + { + print "cookie is OK\n"; + } + else + { + die('cookie is wrong'); + } + + $new_IDs = array(); + $new_DLs = array(); + + $boards = array( + // Videopac / Odyssey2 + 2, // Anything Videopac / Odyssey2 + 28, // VP/O2 Video Gameography + 31, // VP/O2 programmers list + 6, // Games + 25, // Game of the Month + 38, // New releases + 26, // Released Homebrews and Prototypes list + 43, // Homebrew and prototype release schedule + 7, // Hardware + 12, // Stories... + 21, // Other Videopac / Odyssey2 sites + // Collecting + 34, // Rarity Lists + 36, // Console Rarity List + 33, // Jopac Rarity List + 23, // Radiola Rarity List + 29, // Siera Rarity List + 35, // Japanes Rarity list + 41, // Wanted lists + 5, // Swap & Sell + 4, // My Collection + // Programming the Videopac / Odyssey2 + 3, // Programming + 22, // Homebrews + 32, // Unreleased HomeBrew and test code + // Emulation + 8, // Emulating the Videopac / Odyssey2 + 9, // The Videopac Base + 27, // Forum Arcade + // Anything not specifically Videopac / Odyssey2 + 39, // Events + 17, // Other Systems + 18, // Other games + 42, // eBay Oddballz + 19, // Humor + 20, // Anything else... + // About this forum. + 40, // How to register... + 11, // Read this first! + 13, // Videopac / Odyssey2 forum + ); + + foreach ($boards as $board) + { + $maxboardpage = 1000; + $firstDate2 = ''; + + for ($boardpage = 0; $boardpage < $maxboardpage; $boardpage++) + { + print "load board: ".$board.".".($boardpage * 20)."\n"; + $thisboardpage = $boardpage * 20; + + $new_top = 0; + $old_top = 0; + + $firstDateSet2 = true; + + $queryb = getHTML1("http://videopac.nl/forum/index.php?board=".$board.".".($boardpage * 20), $_GET["cookie"]); + + $queryb = explode('', $queryb); + + array_splice($queryb, 0, 1); + if (!$queryb) + { + print "empty!\n"; + break; + } + + foreach($queryb as $rowb) + { + $stickyicon = explode('stickyicon', $rowb); + $stickyicon = $stickyicon[1]; + + $topic = explode('
', $rowb); + $count = explode('<', $count[1]); + $count = trim($count[0]); + + $titel = explode('.0&b=28">', $rowb); + $titel = explode('<', $titel[1]); + $titel = trim($titel[0]); + + if ($firstDate2 == $topic."#".$count) + { + $boardpage = $maxboardpage; + break; + } + + if ($firstDateSet2) + { + $firstDate2 = $topic."#".$count; + $firstDateSet2 = false; + } + + if (!$r_query[$topic."#".$count] || $stickyicon) + { + $maxpages = 1000; + $firstDate = ''; + + for($page=0; $page < $maxpages; $page++) + { + $firstDateSet = true; + $new = 0; + $old = 0; + + print "load page: ".$topic.".".($page * 15); + + $query = getHTML1("http://videopac.nl/forum/index.php?topic=".$topic.".".($page * 15), $_GET["cookie"]); + $query = explode('', $query); + array_splice($query, 0, 1); + + foreach ($query as $row) + { + $time = explode(" on: ", $row); + $time = explode(" »", $time[1]); + $time = $time[0]; + $time = strtotime($time); + $time = date('Y.m.d H.i', $time); + + if ($firstDate == $time) + { + $page = $maxpages; + break; + } + + if($firstDateSet) + { + $firstDate = $time; + $firstDateSet = false; + } + + $dls = explode('", $dl); + $dl = explode('&b=28">* ', $dl[0]); + + $dl_id = urldecode($dl[0]); + + if ($dl[1]) + { + $dl_title = $dl[1]; + + $dl_ext = explode('.', $dl_title); + $dl_ext = strtolower($dl_ext[count($dl_ext) - 1]); + $dl_title = $titel.' ('.substr($dl_title, 0, -(strlen($dl_ext) + 1)).') ('.$time.').'.$dl_ext; + + if (!$r_query[$dl_id]) + { + $new_IDs[] = $dl_id; + $new_DLs[] = array($dl_id, $dl_title); + $new++; + } + else + { + $old++; + $page = $maxpages; + break; + } + } + } + } + + print ", new: ".$new.", old: ".$old."\n"; + } + + $new_top++; + if (!$stickyicon) + { + $new_IDs[] = $topic."#".$count; + } + } + else + { + $boardpage = $maxboardpage; + $old_top++; + break; + } + } + + print "close board: ".$board.".".$thisboardpage.", new: ".$new_top.", old: ".$old_top."\n"; + } + } + + print "
";
+	
+	foreach ($new_IDs as $url)
+	{
+		print $url."\n";
+	}
+	
+	print "
+
";
+	
+	foreach ($new_DLs as $url)
+	{
+		print "".$url[1]."\n";
+	}
+	
+	print "
"; + + } + else + { + print"
+ + + + +
"; + } +} +elseif ($_GET["type"] == 'forum') +{ + if ($_GET["cookie"]) + { + print "
";
+
+		$queryb = getHTML2("http://videopac.nl/forum/index.php", $_GET["cookie"]);
+		$queryb = explode('WoD', $queryb);
+
+		if ($queryb[1])
+		{
+			print "cookie is OK\n";
+		}
+		else
+		{
+			die('cookie is wrong');
+        }
+
+		$new_IDs = array();
+		$new_DLs = array();
+
+		$boards = array(
+				//	Videopac / Odyssey2
+			2,	//		Anything Videopac / Odyssey2
+			28,	//			VP/O2 Video Gameography
+			31,	//			VP/O2 programmers list
+			6,	//		Games
+			25,	//			Game of the Month
+			38,	//		New releases
+			26,	//			Released Homebrews and Prototypes list
+			43,	//			Homebrew and prototype release schedule
+			7,	//		Hardware
+			12,	//		Stories...
+			21,	//		Other Videopac / Odyssey2 sites
+				//	Collecting
+			34,	//		Rarity Lists
+			36,	//			Console Rarity List
+			33,	//			Jopac Rarity List
+			23,	//			Radiola Rarity List
+			29,	//			Siera Rarity List
+			35,	//			Japanes Rarity list
+			41,	//		Wanted lists
+			5,	//		Swap & Sell
+			4,	//		My Collection
+				//	Programming the Videopac / Odyssey2
+			3,	//		Programming
+			22,	//		Homebrews
+			32,	//		Unreleased HomeBrew and test code
+				//	Emulation
+			8,	//		Emulating the Videopac / Odyssey2
+			9,	//		The Videopac Base
+			27,	//		Forum Arcade
+				//	Anything not specifically Videopac / Odyssey2
+			39,	//		Events
+			17,	//		Other Systems
+			18,	//		Other games
+			42,	//		eBay Oddballz
+			19,	//		Humor
+			20,	//		Anything else...
+				//	About this forum.
+			40,	//		How to register...
+			11,	//		Read this first!
+			13,	//		Videopac / Odyssey2 forum
+		);
+
+		foreach ($boards as $board)
+		{
+			$maxboardpage = 1000;
+			$firstDate2 = '';
+	
+			for ($boardpage = 0; $boardpage < $maxboardpage; $boardpage++)
+			{
+				print "load board: ".$board.".".($boardpage * 20)."\n";
+				$thisboardpage = $boardpage * 20;
+	
+				$new_top = 0;
+				$old_top = 0;
+	
+				$firstDateSet2 = true;
+	
+				$queryb = getHTML2("/forum/index.php?board=".$board.".".($boardpage * 20), $_GET["cookie"]);
+				$queryb = explode('', $queryb);
+				array_splice($queryb, 0, 1);
+				if (!$queryb)
+				{
+					print "empty!\n";
+					break;
+				}
+				
+				foreach ($queryb as $rowb)
+				{	
+					$stickyicon = explode('stickyicon', $rowb);
+					$stickyicon = $stickyicon[1];
+	
+					$topic = explode('', $rowb);
+					$count = explode('<', $count[1]);
+					$count = trim($count[0]);
+		
+					$titel = explode('.0">', $rowb);
+					$titel = explode('<', $titel[1]);
+					$titel = trim($titel[0]);
+					
+					if ($firstDate2 == $topic."#".$count)
+					{
+						$boardpage = $maxboardpage;
+						break;
+					}
+	
+					if ($firstDateSet2)
+					{
+						$firstDate2 = $topic."#".$count;
+						$firstDateSet2 = false;
+					}
+					
+					if (!$r_query[$topic."#".$count] || $stickyicon)
+					{
+						$maxpages = 1000;
+						$firstDate = '';
+				
+						for ($page = 0; $page < $maxpages; $page++)
+						{
+							$firstDateSet = true;
+							$new = 0;
+							$old = 0;
+				
+							print "load page: ".$topic.".".($page*15);
+				
+							$query = getHTML2("/forum/index.php?topic=".$topic.".".($page * 15), $_GET["cookie"]);
+							$query = explode('', $query);
+							array_splice($query, 0, 1);
+					
+							foreach ($query as $row)
+							{
+					        	$time = explode(" on: ", $row);
+					        	$time = explode(" »", $time[1]);
+								$time = $time[0];
+								$time = strtotime($time);
+								$time = date('Y.m.d H.i', $time);
+				
+								if ($firstDate == $time)
+								{
+									$page = $maxpages;
+									break;
+								}
+				
+								if ($firstDateSet)
+								{
+									$firstDate = $time;
+									$firstDateSet = false;
+								}
+					
+								$dls = explode('", $dl);
+									$dl = explode('">* ', $dl[0]);
+					
+									$dl_id = $dl[0];
+				
+									if ($dl[1])
+									{
+										$dl_title = $dl[1];
+						
+										$dl_ext = explode('.', $dl_title);
+										$dl_ext = strtolower($dl_ext[count($dl_ext) - 1]);
+										$dl_title = $titel.' ('.substr($dl_title, 0, -(strlen($dl_ext) + 1)).') ('.$time.').'.$dl_ext;
+				
+										if (!$r_query[$dl_id])
+										{
+											$new_IDs[] = $dl_id;
+											$new_DLs[] = array($dl_id, $dl_title);
+											$new++;
+										}
+										else
+										{
+											$old++;
+											$page = $maxpages;
+											break;
+										}
+									}
+								}
+							}
+				
+							print ", new: ".$new.", old: ".$old."\n";
+						}
+
+						$new_top++;
+						if (!$stickyicon)
+						{
+							$new_IDs[] = $topic."#".$count;
+						}
+					}
+					else
+					{
+						$boardpage = $maxboardpage;
+						$old_top++;
+						break;
+					}
+				}
+	
+				print "close board: ".$board.".".$thisboardpage.", new: ".$new_top.", old: ".$old_top."\n";
+			}
+		}
+
+		print "
";
+		
+		foreach ($new_IDs as $url)
+		{
+			print $url."\n";
+		}
+		
+		print "
+
";
+		
+		foreach ($new_DLs as $url)
+		{
+			print "".$url[1]."\n";
+		}
+		
+		print "
"; + + } + else + { + print"
+ + + + +
"; + } +} +elseif ($_GET["type"] == 'main') +{ + $dirs = array( + 'http://videopac.nl/games/games_videopac.php', + 'http://videopac.nl/games/games_imagic.php', + 'http://videopac.nl/games/games_jopac.php', + 'http://videopac.nl/games/games_parker.php', + 'http://videopac.nl/games/games_new.php', + ); + + print "
check folders:\n\n";
+	
+	foreach($dirs as $dir)
+	{
+		listDir1($dir);
+	}
+	
+	print "\nnew urls:\n\n";
+
+	print "
";
+	
+	foreach ($found as $url)
+	{
+		print "".$url[0]."\n";
+	}
+	
+	print "
";
+	
+	foreach ($found as $url)
+	{
+		print $url[1]."\n";
+	}
+
+	print "
"; +} +elseif ($_GET["type"] == 'main2') +{ + $dirs = array( + 'http://videopac.nl/games/games_videopac.php', + 'http://videopac.nl/games/games_imagic.php', + 'http://videopac.nl/games/games_jopac.php', + 'http://videopac.nl/games/games_parker.php', + 'http://videopac.nl/games/games_new.php', + ); + + print "
check folders:\n\n";
+	
+	foreach ($dirs as $dir)
+	{
+		listDir2($dir);
+	}
+	
+	print "\nnew urls:\n\n";
+
+	print "
";
+	
+	foreach ($found as $url)
+	{
+		print "".$url[0]."\n";
+	}
+	
+	print "
";
+	
+	foreach ($found as $url)
+	{
+		print $url[2]."\n";
+	}
+
+	print "
"; +} +else +{ + print "
";
+	print "load main\n";
+	print "load forum\n";
+	print "load main with proxy\n";
+	print "load forum with proxy\n";
+}
+
+function getHTML1($target,$cookie)
+{
 	GLOBAL $GLOBALS;
 
 	$timeout = 100;  // Max time for stablish the conection
@@ -30,253 +590,19 @@ if($_GET["type"]=='forum2'){
 
 	$ret = '';
 	$lastlen=1;
-	  	socket_set_timeout($socket, 2);
+	socket_set_timeout($socket, 2);
 	while ($lastlen>0)
 	{
 		$temp = fread($socket,1024*4);
 		$lastlen=strlen($temp);
-	    $ret .=$temp;
+		$ret .=$temp;
 	}
 	fclose( $socket );
 
 	return $ret;
 }
 
-	//$query=implode ('', file ("http://two.webproxy.at/surf/browse.php?u=".urlencode($dir)."&b=28"));
-
-
-	if($_GET["cookie"])	{
-		print "
";
-
-		$r_query=implode ('', file ($_GET["source"]."/ids.txt"));
-		$r_query=explode ("\r\n","\r\n".$r_query);
-		$r_query=array_flip($r_query);
-
-		$queryb=getHTML("http://videopac.nl/forum/index.php",$_GET["cookie"]);
-
-		$queryb=explode ('WoD',$queryb);
-
-		if($queryb[1]){
-			print "cookie is OK\n";
-		}else{
-			die('cookie is wrong');
-        }
-
-		$new_IDs=Array();
-		$new_DLs=Array();
-
-		$boards=Array(
-				//	Videopac / Odyssey2
-			2,	//		Anything Videopac / Odyssey2
-			28,	//			VP/O2 Video Gameography
-			31,	//			VP/O2 programmers list
-			6,	//		Games
-			25,	//			Game of the Month
-			38,	//		New releases
-			26,	//			Released Homebrews and Prototypes list
-			43,	//			Homebrew and prototype release schedule
-			7,	//		Hardware
-			12,	//		Stories...
-			21,	//		Other Videopac / Odyssey2 sites
-				//	Collecting
-			34,	//		Rarity Lists
-			36,	//			Console Rarity List
-			33,	//			Jopac Rarity List
-			23,	//			Radiola Rarity List
-			29,	//			Siera Rarity List
-			35,	//			Japanes Rarity list
-			41,	//		Wanted lists
-			5,	//		Swap & Sell
-			4,	//		My Collection
-				//	Programming the Videopac / Odyssey2
-			3,	//		Programming
-			22,	//		Homebrews
-			32,	//		Unreleased HomeBrew and test code
-				//	Emulation
-			8,	//		Emulating the Videopac / Odyssey2
-			9,	//		The Videopac Base
-			27,	//		Forum Arcade
-				//	Anything not specifically Videopac / Odyssey2
-			39,	//		Events
-			17,	//		Other Systems
-			18,	//		Other games
-			42,	//		eBay Oddballz
-			19,	//		Humor
-			20,	//		Anything else...
-				//	About this forum.
-			40,	//		How to register...
-			11,	//		Read this first!
-			13,	//		Videopac / Odyssey2 forum
-		);
-
-		foreach($boards as $board){
-
-			$maxboardpage=1000;
-			$firstDate2='';
-	
-			for($boardpage=0;$boardpage<$maxboardpage;$boardpage++)
-			{
-				print "load board: ".$board.".".($boardpage*20)."\n";
-				$thisboardpage=$boardpage*20;
-	
-				$new_top=0;
-				$old_top=0;
-	
-				$firstDateSet2=true;
-	
-				$queryb=getHTML("http://videopac.nl/forum/index.php?board=".$board.".".($boardpage*20),$_GET["cookie"]);
-
-				$queryb=explode ('',$queryb);
-
-				array_splice ($queryb,0,1);
-				if(!$queryb){
-					print "empty!\n";
-					break;
-				}
-
-				foreach($queryb as $rowb){
-					
-					$stickyicon=explode ('stickyicon',$rowb);
-					$stickyicon=$stickyicon[1];
-
-					$topic=explode ('',$rowb);
-					$count=explode ('<',$count[1]);
-					$count=trim($count[0]);
-
-					$titel=explode ('.0&b=28">',$rowb);
-					$titel=explode ('<',$titel[1]);
-					$titel=trim($titel[0]);
-					
-					if($firstDate2==$topic."#".$count)
-					{
-						$boardpage=$maxboardpage;
-						break;
-					}
-	
-					if($firstDateSet2)
-					{
-						$firstDate2=$topic."#".$count;
-						$firstDateSet2=false;
-					}
-					
-					if((!$r_query[$topic."#".$count])||($stickyicon))
-					{
-						$maxpages=1000;
-						$firstDate='';
-				
-						for($page=0;$page<$maxpages;$page++)
-						{
-							$firstDateSet=true;
-							$new=0;
-							$old=0;
-				
-							print "load page: ".$topic.".".($page*15);
-				
-							$query=getHTML("http://videopac.nl/forum/index.php?topic=".$topic.".".($page*15),$_GET["cookie"]);
-							$query=explode ('',$query);
-							array_splice ($query,0,1);
-
-							foreach($query as $row){
-					        	$time=explode (" on: ",$row);
-					        	$time=explode (" »",$time[1]);
-								$time=$time[0];
-								$time=strtotime($time);
-								$time=date('Y.m.d H.i',$time);
-				
-								if($firstDate==$time)
-								{
-									$page=$maxpages;
-									break;
-								}
-				
-								if($firstDateSet)
-								{
-									$firstDate=$time;
-									$firstDateSet=false;
-								}
-					
-								$dls=explode ('",$dl);
-									$dl=explode ('&b=28">* ',$dl[0]);
-					
-									$dl_id=urldecode($dl[0]);
-				
-									if($dl[1]){
-										$dl_title=$dl[1];
-						
-										$dl_ext=explode ('.',$dl_title);
-										$dl_ext=strtolower($dl_ext[count($dl_ext)-1]);
-										$dl_title=$titel.' ('.substr($dl_title, 0, -(strlen($dl_ext)+1)).') ('.$time.').'.$dl_ext;
-				
-										if(!$r_query[$dl_id])
-										{
-											$new_IDs[]=$dl_id;
-											$new_DLs[]=Array($dl_id,$dl_title);
-											$new++;
-										}
-										else
-										{
-											$old++;
-											$page=$maxpages;
-											break;
-										}
-									}
-								}
-							}
-				
-							print ", new: ".$new.", old: ".$old."\n";
-						}
-
-						$new_top++;
-						if(!$stickyicon)$new_IDs[]=$topic."#".$count;
-					}
-					else
-					{
-						$boardpage=$maxboardpage;
-						$old_top++;
-						break;
-					}
-				}
-	
-				print "close board: ".$board.".".$thisboardpage.", new: ".$new_top.", old: ".$old_top."\n";
-			}
-		}
-
-	print "
";
-	
-	foreach($new_IDs as $url)
-	{
-		print $url."\n";
-	}
-	
-	print "
-
";
-	
-	foreach($new_DLs as $url)
-	{
-		print "".$url[1]."\n";
-	}
-	
-	print "
"; - - - }else{ - print"
- - - - -
"; - } - -}elseif($_GET["type"]=='forum'){ - function getHTML($target,$cookie){ +function getHTML2($target,$cookie){ GLOBAL $GLOBALS; $timeout = 100; // Max time for stablish the conection @@ -289,23 +615,23 @@ if($_GET["type"]=='forum2'){ $method = "GET"; if ( is_array( $gets ) ) { - $getValues = '?'; - foreach( $gets AS $name => $value ){ - $getValues .= urlencode( $name ) . "=" . urlencode( $value ) . '&'; - } - $getValues = substr( $getValues, 0, -1 ); + $getValues = '?'; + foreach( $gets AS $name => $value ){ + $getValues .= urlencode( $name ) . "=" . urlencode( $value ) . '&'; + } + $getValues = substr( $getValues, 0, -1 ); } else { - $getValues = ''; + $getValues = ''; } - + if ( is_array( $posts ) ) { - foreach( $posts AS $name => $value ){ - $postValues .= urlencode( $name ) . "=" . urlencode( $value ) . '&'; - } - $postValues = substr( $postValues, 0, -1 ); - $method = "POST"; + foreach( $posts AS $name => $value ){ + $postValues .= urlencode( $name ) . "=" . urlencode( $value ) . '&'; + } + $postValues = substr( $postValues, 0, -1 ); + $method = "POST"; } else { - $postValues = ''; + $postValues = ''; } $request = "$method $target$getValues HTTP/1.1\r\n"; @@ -327,451 +653,133 @@ if($_GET["type"]=='forum2'){ $ret = ''; $lastlen=1; - socket_set_timeout($socket, 2); + socket_set_timeout($socket, 2); while ($lastlen>0) { $temp = fread($socket,1024*4); $lastlen=strlen($temp); - $ret .=$temp; + $ret .=$temp; } fclose( $socket ); return $ret; } +function listDir1($dir){ + GLOBAL $found, $r_query; - if($_GET["cookie"]) { - print "
";
+	print "load: ".$dir."\n";
 
-		$r_query=implode ('', file ($_GET["source"]."/ids.txt"));
-		$r_query=explode ("\r\n","\r\n".$r_query);
-		$r_query=array_flip($r_query);
+	$query = implode('', file ($dir));
+	$query = explode('',$query);
 
-		$queryb=getHTML("http://videopac.nl/forum/index.php",$_GET["cookie"]);
-		$queryb=explode ('WoD',$queryb);
+	$new=0;
+	$old=0;
 
-		if($queryb[1]){
-			print "cookie is OK\n";
-		}else{
-			die('cookie is wrong');
-        }
+	foreach($query as $row){
+		$title = explode('',$title[1]);
+		$url=$title[0];
+		$url = explode('',$row);
+			$title2 = explode('',$title2[1]);
+			$title2=trim(strip_tags($title2[0]));
 
-		$boards=Array(
-				//	Videopac / Odyssey2
-			2,	//		Anything Videopac / Odyssey2
-			28,	//			VP/O2 Video Gameography
-			31,	//			VP/O2 programmers list
-			6,	//		Games
-			25,	//			Game of the Month
-			38,	//		New releases
-			26,	//			Released Homebrews and Prototypes list
-			43,	//			Homebrew and prototype release schedule
-			7,	//		Hardware
-			12,	//		Stories...
-			21,	//		Other Videopac / Odyssey2 sites
-				//	Collecting
-			34,	//		Rarity Lists
-			36,	//			Console Rarity List
-			33,	//			Jopac Rarity List
-			23,	//			Radiola Rarity List
-			29,	//			Siera Rarity List
-			35,	//			Japanes Rarity list
-			41,	//		Wanted lists
-			5,	//		Swap & Sell
-			4,	//		My Collection
-				//	Programming the Videopac / Odyssey2
-			3,	//		Programming
-			22,	//		Homebrews
-			32,	//		Unreleased HomeBrew and test code
-				//	Emulation
-			8,	//		Emulating the Videopac / Odyssey2
-			9,	//		The Videopac Base
-			27,	//		Forum Arcade
-				//	Anything not specifically Videopac / Odyssey2
-			39,	//		Events
-			17,	//		Other Systems
-			18,	//		Other games
-			42,	//		eBay Oddballz
-			19,	//		Humor
-			20,	//		Anything else...
-				//	About this forum.
-			40,	//		How to register...
-			11,	//		Read this first!
-			13,	//		Videopac / Odyssey2 forum
-		);
+			$dl = implode('', file ("http://videopac.nl/games/".$url));
+			$dl = explode('">',$queryb);
-				array_splice ($queryb,0,1);
-				if(!$queryb){
-					print "empty!\n";
-					break;
+				if(!$r_query[$url])
+				{
+					$found[]=array($title,$url);
+					$new++;
 				}
-				
-				foreach($queryb as $rowb){
-					
-					$stickyicon=explode ('stickyicon',$rowb);
-					$stickyicon=$stickyicon[1];
-	
-					$topic=explode ('',$rowb);
-					$count=explode ('<',$count[1]);
-					$count=trim($count[0]);
-		
-					$titel=explode ('.0">',$rowb);
-					$titel=explode ('<',$titel[1]);
-					$titel=trim($titel[0]);
-					
-					if($firstDate2==$topic."#".$count)
-					{
-						$boardpage=$maxboardpage;
-						break;
-					}
-	
-					if($firstDateSet2)
-					{
-						$firstDate2=$topic."#".$count;
-						$firstDateSet2=false;
-					}
-					
-					if((!$r_query[$topic."#".$count])||($stickyicon))
-					{
-						$maxpages=1000;
-						$firstDate='';
-				
-						for($page=0;$page<$maxpages;$page++)
-						{
-							$firstDateSet=true;
-							$new=0;
-							$old=0;
-				
-							print "load page: ".$topic.".".($page*15);
-				
-							$query=getHTML("/forum/index.php?topic=".$topic.".".($page*15),$_GET["cookie"]);
-							$query=explode ('',$query);
+$query = implode('', file($dir));
+$query = explode('', $query);
 
-$query=explode('',$query[1]);
-$query=str_replace(
-	array("\n",'',''),
-	array(" ",' (',')'),
+$query = explode('', $query[1]);
+$query = str_replace(
+	array("\n", '', ''),
+	array(" ", ' (', ')'),
 	$query[0]);
 
-$query=explode('',$query);
+$query = explode('', $query);
 
-foreach($query as $row){
-	$row=explode('
',$row); + $title = explode('
',$query); - array_splice ($query,0,1); - - foreach($query as $row){ - $time=explode (" on: ",$row); - $time=explode (" »",$time[1]); - $time=$time[0]; - $time=strtotime($time); - $time=date('Y.m.d H.i',$time); - - if($firstDate==$time) - { - $page=$maxpages; - break; - } - - if($firstDateSet) - { - $firstDate=$time; - $firstDateSet=false; - } - - $dls=explode ('",$dl); - $dl=explode ('">* ',$dl[0]); - - $dl_id=$dl[0]; - - if($dl[1]){ - $dl_title=$dl[1]; - - $dl_ext=explode ('.',$dl_title); - $dl_ext=strtolower($dl_ext[count($dl_ext)-1]); - $dl_title=$titel.' ('.substr($dl_title, 0, -(strlen($dl_ext)+1)).') ('.$time.').'.$dl_ext; - - if(!$r_query[$dl_id]) - { - $new_IDs[]=$dl_id; - $new_DLs[]=Array($dl_id,$dl_title); - $new++; - } - else - { - $old++; - $page=$maxpages; - break; - } - } - } - } - - print ", new: ".$new.", old: ".$old."\n"; - } - - $new_top++; - if(!$stickyicon)$new_IDs[]=$topic."#".$count; - } - else - { - $boardpage=$maxboardpage; - $old_top++; - break; - } + else + { + $old++; } - - print "close board: ".$board.".".$thisboardpage.", new: ".$new_top.", old: ".$old_top."\n"; } } - - print "
";
-	
-	foreach($new_IDs as $url)
-	{
-		print $url."\n";
 	}
-	
-	print "
-
";
-	
-	foreach($new_DLs as $url)
-	{
-		print "".$url[1]."\n";
-	}
-	
-	print "
"; + print "close: ".$dir."\n"; + print "new: ".$new.", old: ".$old."\n"; +} - }else{ - print"
- - - - -
"; - } +function listDir2($dir){ + GLOBAL $found, $r_query; -}elseif($_GET["type"]=='main'){ - $dirs=Array( - 'http://videopac.nl/games/games_videopac.php', - 'http://videopac.nl/games/games_imagic.php', - 'http://videopac.nl/games/games_jopac.php', - 'http://videopac.nl/games/games_parker.php', - 'http://videopac.nl/games/games_new.php', - ); - - $r_query=implode ('', file ($_GET["source"]."/ids.txt")); - $r_query=explode ("\r\n","\r\n".$r_query); - $r_query=array_flip($r_query); - - $newURLs=Array(); - - function listDir($dir){ - GLOBAL $newURLs, $r_query; - - print "load: ".$dir."\n"; - - $query=implode ('', file ($dir)); - $query=explode('',$query); - - $new=0; - $old=0; + print "load: ".$dir."\n"; - foreach($query as $row){ - $title=explode('',$title[1]); - $url=$title[0]; - $url=explode('',$query); - if($url) - { - $title2=explode('',$title2[1]); - $title2=trim(strip_tags($title2[0])); - - $dl=implode ('', file ("http://videopac.nl/games/".$url)); - $dl=explode('">',$row); + $title = explode('',$title[1]); + $url=$title[0]; + $url = explode('',$row); + $title2 = explode('',$title2[1]); + $title2=trim(strip_tags($title2[0])); + + $dl = implode('', file ("http://two.webproxy.at".html_entity_decode($url))); + $dl = explode('">check folders:\n\n"; - - foreach($dirs as $dir) - { - listDir($dir); - } - - print "\nnew urls:\n\n"; - - print "
',$row); - $title=explode('',$row); - $title2=explode('
";
-	
-	foreach($newURLs as $url)
-	{
-		print "".$url[0]."\n";
-	}
-	
-	print "
";
-	
-	foreach($newURLs as $url)
-	{
-		print $url[1]."\n";
 	}
 
-	print "
"; - -}elseif($_GET["type"]=='main2'){ - - $dirs=Array( - 'http://videopac.nl/games/games_videopac.php', - 'http://videopac.nl/games/games_imagic.php', - 'http://videopac.nl/games/games_jopac.php', - 'http://videopac.nl/games/games_parker.php', - 'http://videopac.nl/games/games_new.php', - ); - - $r_query=implode ('', file ($_GET["source"]."/ids.txt")); - $r_query=explode ("\r\n","\r\n".$r_query); - $r_query=array_flip($r_query); - - $newURLs=Array(); - - function listDir($dir){ - GLOBAL $newURLs, $r_query; - - print "load: ".$dir."\n"; - - $query=implode ('', file ("http://two.webproxy.at/surf/browse.php?u=".urlencode($dir)."&b=28")); - $query=explode('',$query); - - $new=0; - $old=0; - - foreach($query as $row){ - $title=explode('',$title[1]); - $url=$title[0]; - $url=explode('',$row); - $title2=explode('',$title2[1]); - $title2=trim(strip_tags($title2[0])); - - $dl=implode ('', file ("http://two.webproxy.at".html_entity_decode($url))); - $dl=explode('">check folders:\n\n"; - - foreach($dirs as $dir) - { - listDir($dir); - } - - print "\nnew urls:\n\n"; - - print "
',$row); - $title=explode('
";
-	
-	foreach($newURLs as $url)
-	{
-		print "".$url[0]."\n";
-	}
-	
-	print "
";
-	
-	foreach($newURLs as $url)
-	{
-		print $url[2]."\n";
-	}
-
-	print "
"; - -}else{ - print "
";
-	print "load main\n";
-	print "load forum\n";
-	print "load main with proxy\n";
-	print "load forum with proxy\n";
-
+	print "close: ".$dir."\n";
+	print "new: ".$new.", old: ".$old."\n";
 }
 
 ?>
\ No newline at end of file
diff --git a/wizzardRedux/sites/VimmsLair.php b/wizzardRedux/sites/VimmsLair.php
index eba77f0..76a0b97 100644
--- a/wizzardRedux/sites/VimmsLair.php
+++ b/wizzardRedux/sites/VimmsLair.php
@@ -1,97 +1,101 @@
 ";
- 
-	$r_query=implode ('', file ($_GET["source"]."/ids.txt"));
-	$r_query=explode ("\r\n","\r\n".$r_query);
-	$r_query=array_flip($r_query);
 
-	$sections=Array(
-		"number",
-		"A",
-		"B",
-		"C",
-		"D",
-		"E",
-		"F",
-		"G",
-		"H",
-		"I",
-		"J",
-		"K",
-		"L",
-		"M",
-		"N",
-		"O",
-		"P",
-		"Q",
-		"R",
-		"S",
-		"T",
-		"U",
-		"V",
-		"W",
-		"X",
-		"Y",
-		"Z",
-	);
+// Original code: The Wizard of DATz
 
-	$query=implode ('', file ("http://vimm.net/?p=vault"));
-	$query=explode ('?system=', $query);
-	array_splice ($query,0,1);
+print "
";
 
-	$found=Array();
+$sections = array(
+	"number",
+	"A",
+	"B",
+	"C",
+	"D",
+	"E",
+	"F",
+	"G",
+	"H",
+	"I",
+	"J",
+	"K",
+	"L",
+	"M",
+	"N",
+	"O",
+	"P",
+	"Q",
+	"R",
+	"S",
+	"T",
+	"U",
+	"V",
+	"W",
+	"X",
+	"Y",
+	"Z",
+);
 
-	foreach($query as $system){
-		$system=explode ('"', $system);
-		$system=$system[0];
-		print "found ".$system."\n";
-		foreach($sections as $section){
-			$new=0;
-			$old=0;
-			$other=0;
-			print "load ".$section."\n";
-			$ids=implode ('', file ("http://vimm.net/vault/?p=list&action=settings§ion=".$section."&system=".$system."&v_us=1&v_hacked=1&v_prototype=1&v_foreign=1&v_translated=1&v_unlicensed=1"));
-			$ids=explode ('"?p=details&id=', $ids);
-			array_splice ($ids,0,1);
-			foreach($ids as $id){
-				$id=explode ('"', $id);
-				$id=$id[0];
-				
-				if(!$r_query[$id])
+$query = implode('', file("http://vimm.net/?p=vault"));
+$query = explode('?system=', $query);
+array_splice($query, 0, 1);
+
+foreach ($query as $system)
+{
+	$system = explode('"', $system);
+	$system = $system[0];
+	print "found ".$system."\n";
+	foreach ($sections as $section)
+	{
+		$new = 0;
+		$old = 0;
+		$other = 0;
+		print "load ".$section."\n";
+		$ids = implode('', file("http://vimm.net/vault/?p=list&action=settings§ion=".$section."&system=".$system."&v_us=1&v_hacked=1&v_prototype=1&v_foreign=1&v_translated=1&v_unlicensed=1"));
+		$ids = explode('"?p=details&id=', $ids);
+		array_splice($ids, 0, 1);
+		foreach ($ids as $id)
+		{
+			$id = explode('"', $id);
+			$id = $id[0];
+			
+			if (!$r_query[$id])
+			{
+				print "load ".$id."\n";
+				$page = implode('', file("http://vimm.net/vault/?p=details&id=".$id));
+				$page = explode('name="download"', $page);
+
+				if ($page[1])
 				{
-					print "load ".$id."\n";
-					$page=implode ('', file ("http://vimm.net/vault/?p=details&id=".$id));
-					$page=explode ('name="download"', $page);
-
-					if($page[1])
-					{
-						$found[]=Array($id,$system,count($page)-1);
-						$new++;
-					}else{
-                    	$other++;
-					}
+					$found[] = array($id, $system, count($page) - 1);
+					$new++;
 				}
 				else
 				{
-					$old++;
+					$other++;
 				}
 			}
-			print "new: ".$new.", old: ".$old.", other: ".$other."\n";
+			else
+			{
+				$old++;
+			}
 		}
+		print "new: ".$new.", old: ".$old.", other: ".$other."\n";
 	}
+}
 
-	print "
";
-	foreach($found as $row){
-		print $row[0]."\n";
+print "
";
+foreach ($found as $row)
+{
+	print $row[0]."\n";
+}
+print "
"; +print "
";
+foreach ($found as $row)
+{
+	for ($y = 1; $y <= $row[2]; $y++)
+	{
+		print "wget.exe --post-data \"id=".$row[0]."&fileNumber=".$y."\" --user-agent \"Mozilla/5.0 (Windows NT 5.2; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0\"  --referer \"http://vimm.net/vault/?p=details&id=".$x."\" --output-document \"{".$row[1]."}".$row[0].".".$y.".7z\" http://download.vimm.net/download.php\n";
 	}
-	print "
"; - print "
";
-	foreach($found as $row){
-		for($y=1;$y<=$row[2];$y++)
-		{
-			print "wget.exe --post-data \"id=".$row[0]."&fileNumber=".$y."\" --user-agent \"Mozilla/5.0 (Windows NT 5.2; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0\"  --referer \"http://vimm.net/vault/?p=details&id=".$x."\" --output-document \"{".$row[1]."}".$row[0].".".$y.".7z\" http://download.vimm.net/download.php\n";
-		}
-	}
-	print "
"; +} +print "
"; ?> \ No newline at end of file diff --git a/wizzardRedux/sites/vgdb.php b/wizzardRedux/sites/vgdb.php index 600ac40..2d2fd41 100644 --- a/wizzardRedux/sites/vgdb.php +++ b/wizzardRedux/sites/vgdb.php @@ -1,64 +1,63 @@ check folders:\n\n"; print "load: ".$dir."\n"; -$new=0; -$old=0; +$new = 0; +$old = 0; -$query=implode ('', file ($dir)); -$query=explode('
Code Code
'; - $dl=implode ('', file ($dir.$url)); + $dl = implode('', file($dir.$url)); print ''; - $dl=explode('
";
 
-foreach($newURLs as $url)
+foreach ($found as $url)
 {
 	print "".$url[0]."\n";
 }
 
 print "
";
 
-foreach($newURLs as $url)
+foreach ($found as $url)
 {
 	print $url[1]."\n";
 }
diff --git a/wizzardRedux/sites/vic20it.php b/wizzardRedux/sites/vic20it.php
index ee20cf5..3247a67 100644
--- a/wizzardRedux/sites/vic20it.php
+++ b/wizzardRedux/sites/vic20it.php
@@ -1,10 +1,45 @@
 check folders:\n\n";
+
+foreach ($dirs as $dir)
+{
+	listDir($dir);
+}
+
+print "\nnew urls:\n\n";
+
+print "
";
+
+foreach ($found as $url)
+{
+	print "".$url[0]."\n";
+}
+
+print "
";
+
+foreach ($found as $url)
+{
+	print $url[1]."\n";
+}
+
+print "
"; + +function getHTML($target) +{ GLOBAL $GLOBALS; $timeout = 100; // Max time for stablish the conection - + $server = 'vic20.it'; // Ziel domain $host = 'vic20.it'; // Domain name //$target = '/new.html'; // Ziel document @@ -13,25 +48,25 @@ function getHTML($target){ $method = "GET"; if ( is_array( $gets ) ) { - $getValues = '?'; - foreach( $gets AS $name => $value ){ - $getValues .= urlencode( $name ) . "=" . urlencode( $value ) . '&'; - } - $getValues = substr( $getValues, 0, -1 ); + $getValues = '?'; + foreach( $gets AS $name => $value ){ + $getValues .= urlencode( $name ) . "=" . urlencode( $value ) . '&'; + } + $getValues = substr( $getValues, 0, -1 ); } else { - $getValues = ''; + $getValues = ''; } - + if ( is_array( $posts ) ) { - foreach( $posts AS $name => $value ){ - $postValues .= urlencode( $name ) . "=" . urlencode( $value ) . '&'; - } - $postValues = substr( $postValues, 0, -1 ); - $method = "POST"; + foreach( $posts AS $name => $value ){ + $postValues .= urlencode( $name ) . "=" . urlencode( $value ) . '&'; + } + $postValues = substr( $postValues, 0, -1 ); + $method = "POST"; } else { - $postValues = ''; + $postValues = ''; } - + $request = "$method $target$getValues HTTP/1.1\r\n"; $request .= "Accept: ".$GLOBALS[_SERVER][HTTP_ACCEPT]."\r\n"; $request .= "Referer: ".$referer."\r\n"; @@ -50,74 +85,62 @@ function getHTML($target){ $ret = ''; $lastlen=1; - socket_set_timeout($socket, 2); + socket_set_timeout($socket, 2); while ($lastlen>0) { $temp = fread($socket,1024*4); $lastlen=strlen($temp); - $ret .=$temp; + $ret .=$temp; } fclose( $socket ); - + return $ret; } - -$dirs=Array( - Array('PaperSoft Prima serie','http://vic20.it/papersoft/1-1.html?ckattempt=1'), - Array('PaperSoft Prima serie','http://vic20.it/papersoft/1-2.html?ckattempt=1'), - Array('PaperSoft Seconda serie','http://vic20.it/papersoft/2-2.html?ckattempt=1'), - Array('PaperSoft Terza serie','http://vic20.it/papersoft/3-2.html?ckattempt=1'), -); - -$r_query=implode ('', file ($_GET["source"]."/ids.txt")); -$r_query=explode ("\r\n","\r\n".$r_query); -$r_query=array_flip($r_query); - -$newURLs=Array(); - -function listDir($dir){ - GLOBAL $newURLs, $r_query; +function listDir($dir) +{ + GLOBAL $found, $r_query; print "load: ".$dir[1]."\n"; - $query=getHTML($dir[1]); - $query=str_replace('
','

',$query); - $query=explode('

',$query); - $query[0]=null; + $query = getHTML($dir[1]); + $query = str_replace('

','

', $query); + $query = explode('

', $query); + $query[0] = null; - $new=0; - $old=0; + $new = 0; + $old = 0; - foreach($query as $row){ - if($row){ - $title=explode('check folders:\n\n"; - -foreach($dirs as $dir) -{ - listDir($dir); -} - -print "\nnew urls:\n\n"; - -print "
";
-
-foreach($newURLs as $url)
-{
-	print "".$url[0]."\n";
-}
-
-
-print "
";
-
-foreach($newURLs as $url)
-{
-	print $url[1]."\n";
-}
-
-print "
"; - ?> \ No newline at end of file