All pastes #952074 Raw Edit

unexpected error

public php v1 · immutable
#952074 ·published 2008-03-21 21:47 UTC
rendered paste body
<?phpini_set('display_errors', true);ini_set('error_reporting', E_ERROR | E_WARNING | E_PARSE);set_time_limit(0);// separate results from diff video sites, as views could be skewedrequire_once "curl2.php";class VideoScraper{	protected $keywords;	protected $cs = new CurlSingle;	protected $cm = new Curl;		public function __construct($keywords)	{		if(!is_array($keywords))			die('<strong>Error:</strong> arg $keywords expecting array');		$this->keywords = $keywords;		$this->keywords = array_merge($this->build_keywords(), $this->keywords);			}		public function scrape($yt = true, $break = true, $myspace = true, $stupidvideos = true)	{		$this->build_keywords();		echo var_dump($this->keywords);	}		protected function build_keywords()	{		$keywords = $this->keywords;		$numkw = count($this->keywords);		foreach($keywords as $kw)		{			$url = 'http://www.youtube.com/results?search_query=' . urlencode($kw);			$cm->add(new CurlRequest($url);		}		$cm->perform();		for($i=0;$i<=$numkw;$i++)		{			echo $contents = $cm->requests[$i]->body;		}	}		protected function youtube()	{	}		protected function break()	{	}		protected function myspace()	{	}		protected function stupidvideos()	{	}}$s = new VideoScraper;$s->scrape();?>