Location: PHPKode > scripts > Usenet Downloader > usenet-downloader/get_server_list.php
<?
set_time_limit(0);

include_once("config.inc.php");

class GetNNTPServerList
	{
/*****************************************************************************************/				
		function GetMoreServers($server)
			{
				if($server=='binaryfeeds'||$server=='disenter')
					{
						if($server=='binaryfeeds')$contents=file_get_contents("http://www.binaryfeeds.com/");
						else if($server=='disenter')$contents=file_get_contents("http://www.disenter.com/");
						preg_match_all("/<a href='news:.*>(.*)<\/a>/iU",$contents,$matches);
						for($count=0;$count<count($matches[1]);$count++)
							{
								$server_name=strip_tags($matches[1][$count]);
								$created_on=date('Y-m-d H:i:s',time());
								
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
								
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='newzbot')
					{
						for($counter=0;$counter<=240;$counter+=40)
							{
								$url="http://www.newzbot.com/serverlist.php?since=ALL&orderby=groupcount&sortorder=desc&show_maxgroup=on&show_post=on&show_kps=on&show_created=on&skip_rows=".$counter;
								$contents=file_get_contents($url);
								preg_match_all("/<a href='\/search.php.*>(.*)<\/a>/iU",$contents,$matches);
								for($count=0;$count<count($matches[1]);$count++)
									{
										$server_name=strip_tags($matches[1][$count]);
										$created_on=date('Y-m-d H:i:s',time());
										
										$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
										$result=mysql_query($select_str);
										if(mysql_num_rows($result)>0)continue;
										
										$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
										echo $insert_str."<br/>";flush();
										mysql_query($insert_str);
									}
							}
					}
				else if($server=='freeusenetnews')
					{
						$url="http://freeusenetnews.com/newspage.html";
						$contents=file_get_contents($url);
						preg_match_all("/<a href=.*>(.*)<\/a>&nbsp;/iU",$contents,$matches);
						for($count=0;$count<count($matches[1]);$count++)
							{
								$server_name=strip_tags($matches[1][$count]);
								$created_on=date('Y-m-d H:i:s',time());
							
								if($server_name=="MY SERVER")continue;
								
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
										
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='usenet__servers.tripod.com')
					{
						$url="http://usenet__servers.tripod.com/doc/docpublic.htm";
						$contents=file_get_contents($url);
						preg_match_all("/<td width=\"386\">(.*)<\/td>/iU",$contents,$matches);
						for($count=0;$count<count($matches[1]);$count++)
							{
								$server_name=$matches[1][$count];
								$created_on=date('Y-m-d H:i:s',time());
								
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
										
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='www.us.mworx.eu')
					{
						$url="http://www.us.mworx.eu/proxy/news.html";
						$contents=file_get_contents($url);
						preg_match_all("/<a href=news:\/\/(.*) /iU",$contents,$matches);
						for($count=0;$count<count($matches[1]);$count++)
							{
								$server_name=$matches[1][$count];
								$created_on=date('Y-m-d H:i:s',time());
								
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
										
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='www.premium-news.com')
					{
						for($counter=1;$counter<3;$counter++)
							{
								$url="http://www.premium-news.com/list0".$counter.".htm";
								$contents=file_get_contents($url);
								preg_match_all("/(.*)<br>\n/iU",$contents,$matches);				
								for($count=1;$count<count($matches[1]);$count++)
									{
										$server_name=trim(strip_tags($matches[1][$count]));
										$created_on=date('Y-m-d H:i:s',time());
										
										$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
										$result=mysql_query($select_str);
										if(mysql_num_rows($result)>0)continue;
												
										$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
										echo $insert_str."<br/>";flush();
										mysql_query($insert_str);
									}
							}
					}
				else if($server=='news.anthologeek.net')
					{
						$url="http://news.anthologeek.net/top1000.current.txt";
						$contents=file_get_contents($url);
						preg_match_all("/\t[^\t]+\t[^\t]+(.*)\n/iU",$contents,$matches);				
						
						for($count=1;$count<count($matches[1]);$count++)
							{
								$temp_arr1=explode(" ",$matches[1][$count]);
								$temp_arr2=explode("\t",trim($temp_arr1[count($temp_arr1)-1]));	
								$server_name=$temp_arr2[1];
								$created_on=date('Y-m-d H:i:s',time());
									
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
												
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='neonet')
					{
						$url="http://www.neonet.bc.ca/sites/usenet.htm";
						$contents=file_get_contents($url);
						preg_match_all("/size=\"2\">(.*)<\/font>/iU",$contents,$matches);				
						
						for($count=1;$count<count($matches[1]);$count++)
							{						
								$server_name=str_replace('size="2">','',$matches[1][$count]);
								$server_name=str_replace('.*','',$server_name);
								$server_name=str_replace('[a #1 site]','',$server_name);
								
								if(strlen($server_name)<4||strpos($server_name,".")===false||strpos($server_name,"@")!==false)continue;
								
								$created_on=date('Y-m-d H:i:s',time());
									
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
												
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='freeusenet')
					{
						$url="http://www.freeusenet.org/component/content/article/53-list-of-free-usenet-servers.html";
						$contents=file_get_contents($url);
						preg_match_all("/<br \/>(.*)<br \/>/iU",$contents,$matches);				
						
						for($count=1;$count<count($matches[1]);$count++)
							{						
								$server_name=str_replace('size="2">','',$matches[1][$count]);
								$server_name=str_replace('.*','',$server_name);
								$server_name=str_replace('[a #1 site]','',$server_name);
								
								if(strlen($server_name)<4||strpos($server_name,".")===false||strpos($server_name,"@")!==false)continue;
								
								$created_on=date('Y-m-d H:i:s',time());
									
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
												
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='hweede')
					{
						$url="http://home.snafu.de/hweede/pulin.htm";
						$contents=file_get_contents($url);
						preg_match_all("/(.*)[ ]+\(.*\)/iU",$contents,$matches);				
						
						for($count=1;$count<count($matches[1]);$count++)
							{						
								$server_name=$matches[1][$count];																		
								
								$created_on=date('Y-m-d H:i:s',time());
									
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
												
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='nntpeng')
					{
						$url="http://80.247.230.136/nntpeng.htm";
						$contents=file_get_contents($url);
						preg_match_all("/news:\/\/.*>(.*)<\/A>/iU",$contents,$matches);				
						
						for($count=1;$count<count($matches[1]);$count++)
							{						
								$server_name=$matches[1][$count];																		
								
								$created_on=date('Y-m-d H:i:s',time());
									
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
												
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='bkraft')
					{
						$url="http://www.nyx.net/~bkraft/";
						$contents=file_get_contents($url);
						preg_match_all("/<I>(.*)<\/I>/iU",$contents,$matches);				
						
						for($count=1;$count<count($matches[1]);$count++)
							{						
								$server_name=$matches[1][$count];																		
								
								if(strlen($server_name)<4||strpos($server_name,".")===false||strpos($server_name,"@")!==false)continue;
								
								$created_on=date('Y-m-d H:i:s',time());
									
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
												
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='new_list1')
					{				
						$contents=file_get_contents("news_servers.txt");
						preg_match_all("/News Server Name:(.*)\r\n/iU",$contents,$matches);
						
						for($count=1;$count<count($matches[1]);$count++)
							{						
								$server_name=str_replace(" ","",$matches[1][$count]);																		
								
								if(strlen($server_name)<4||strpos($server_name,".")===false||strpos($server_name,"@")!==false)continue;
								
								$created_on=date('Y-m-d H:i:s',time());
									
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
												
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='new_list2')
					{				
						$contents=file_get_contents("news_servers2.txt");
						preg_match_all("/(.*) +(.*)\r\n/iU",$contents,$matches);
						
						for($count=1;$count<count($matches[1]);$count++)
							{						
								$server_name=str_replace(" ","",$matches[1][$count]);																		
								
								if(strlen($server_name)<4||strpos($server_name,".")===false||strpos($server_name,"@")!==false)continue;
								
								$created_on=date('Y-m-d H:i:s',time());
									
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
												
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='cab')
					{
						$url="http://www.cab.u-szeged.hu/linux/misc/free-news-servers.html";
						$contents=file_get_contents($url);
						preg_match_all("/Host:.*href=\"news:\/\/(.*)\/?\"/iU",$contents,$matches);				
						
						for($count=1;$count<count($matches[1]);$count++)
							{						
								$server_name=$matches[1][$count];																		
								//echo $server_name."<br/>";continue;
								if(strlen($server_name)<4||strpos($server_name,".")===false||strpos($server_name,"@")!==false)continue;
								
								$created_on=date('Y-m-d H:i:s',time());
									
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
												
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				
				else if($server=='netwu')
					{
						$url="http://www.netwu.com/newswolf/list.htm";
						$contents=file_get_contents($url);
						preg_match_all("/<p><a href=\"news:\/\/(.*)\"/iU",$contents,$matches);				
						
						for($count=1;$count<count($matches[1]);$count++)
							{						
								$server_name=$matches[1][$count];																		
								//echo $server_name."<br/>";continue;
								if(strlen($server_name)<4||strpos($server_name,".")===false||strpos($server_name,"@")!==false)continue;
								
								$created_on=date('Y-m-d H:i:s',time());
									
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
												
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='netwu')
					{
						$url="http://www.netwu.com/newswolf/list.htm";
						$contents=file_get_contents($url);
						preg_match_all("/<p><a href=\"news:\/\/(.*)\"/iU",$contents,$matches);				
						
						for($count=1;$count<count($matches[1]);$count++)
							{						
								$server_name=$matches[1][$count];																		
								//echo $server_name."<br/>";continue;
								if(strlen($server_name)<4||strpos($server_name,".")===false||strpos($server_name,"@")!==false)continue;
								
								$created_on=date('Y-m-d H:i:s',time());
									
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
												
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
				else if($server=='craigsweb')
					{
						$url="http://www.craigsweb.com/newsrv.html";
						$contents=file_get_contents($url);
						preg_match_all("/<A HREF=\"news:\/\/(.*)\/?\"/iU",$contents,$matches);				
						
						for($count=1;$count<count($matches[1]);$count++)
							{						
								$server_name=$matches[1][$count];																		
								//echo $server_name."<br/>";continue;
								if(strlen($server_name)<4||strpos($server_name,".")===false||strpos($server_name,"@")!==false)continue;
								
								$created_on=date('Y-m-d H:i:s',time());
									
								$select_str="SELECT * FROM mp_usenet_servers WHERE name='".$server_name."'";
								$result=mysql_query($select_str);
								if(mysql_num_rows($result)>0)continue;
												
								$insert_str="INSERT INTO mp_usenet_servers(name,created_on) VALUES('".$server_name."','".$created_on."')";
								echo $insert_str."<br/>";flush();
								mysql_query($insert_str);
							}
					}
			}
/*****************************************************************************************/								
	}
Return current item: Usenet Downloader