rendered paste body<?php
$lines = array('jay+z');
foreach($lines as $line){
$filename = trim($line);
echo "<b> $line </b><br>";
//$url = "http://www.google.com/musicsearch?q=$filename&btnG=Search+Music";
$url = "http://www.whatismyip.net/cgi-bin/your_ip_is.cgi";
//$output = file_get_contents($url);
$proxy = "127.0.0.1:8118";
$data = getURL($url,$proxy);
echo $data;
$regex = '/musica[?]aid=(.+?)>/';
preg_match($regex,$data,$match);
$match = $match[1];
echo $match;
//$url2 = "http://www.google.com/musicad?aid=$match";
//$output2 = file_get_contents($url2);
//$regex2 = "/$match><b>(.+?)<\/b><\/a><br>/";
//preg_match_all($regex2,$output2,$match2);
//foreach ($match2[1] as $val) {
//echo $val . "<br>";
//}
//$regex3 = '/<a href=\/musics\?lid=(.+?)&sid=(.+?)>(.+?)<\/a>/';
//preg_match_all($regex3,$output2,$match3);
//var_dump($match3);
//print_r($match3);
//foreach ($match3[3] as $val2){
//var_dump($match3);
//echo $match3;
//echo $val2."<br>";
// }
}
function getURL($url,$proxy) {
$data = '';
$ch = curl_init() or die(curl_error());
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2","Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5","Accept-Language: en-us,en;q=0.5","Accept-Encoding: *","Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7","Keep-Alive: 300","Connection: keep-alive","Expect: "));
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt ($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);// or die(curl_error($ch));
curl_close($ch);
return $data;
}
?>