Country:

search by number or search by keyword
(.*)<\/title>/isU',$imdb_content); $director = strip_tags(get_match('/]*>Director:<\/h5>(.*)<\/div>/isU',$imdb_content)); $plot = get_match('/]*>Plot:<\/h5>(.*)<\/div>/isU',$imdb_content); $genre_original = get_match('/]*>Genre:<\/h5>(.*)<\/div>/isU',$imdb_content); $genre_processed_once = str_replace('MPAA<\/a>:<\/h5>(.*)<\/div>/isU',$imdb_content); $run_time = get_match('/Runtime:<\/h5>(.*)<\/div>/isU',$imdb_content); $user_rating = get_match('/
\n (.*)<\/b>/isU',$imdb_content); $poster = get_match('//isU',$imdb_content); //$img = explode("\" ", $name); $img //$img = get_match('/title="'.$img[0].'\"" src="(.*)" \\/>/isU',$imdb_content); //echo "image:".$img; //build content $content.= '

Film

'.$name.'

'."\n"; if ( $poster != '' ) { $content.= '

Poster

'.$name.'
link to poster
(not authorized)

'."\n"; } else $content.= '

Poster

No Poster available

'."\n"; $content.= '

Director

'.$director.'

'."\n"; $content.= '

Plot

'.substr($plot,0,strpos($plot,''."\n"; $content.= '

Genre

'.$genre.'

'."\n"; $content.= '

Keywords

'.$keywords.'

'."\n"; $content.= '

Tagline

'.$tagline.'

'."\n"; $content.= '

Awards

'.$awards.'

'."\n"; $content.= '

Release Date

'.substr($release_date,0,strpos($release_date,''."\n"; $content.= '

MPAA

'.$mpaa.'

'."\n"; $content.= '

Run Time

'.$run_time.'

'."\n"; $content.= '

User Rating

'.$user_rating.'

'."\n"; $content.= '

Full Details

'.$url.'

'."\n"; // echo $content; //build csv content if ( $name != '' ) { $csv_content.= str_replace("\n",'',str_replace('|','-',$name))."|"; } else $csv_content.= "|"; if ( $poster != '' ) { $csv_content.= str_replace("\n",'',str_replace('|','-',$poster))."|"; } else $csv_content.= "|"; if ( $director != '' ) { $csv_content.= ltrim(rtrim(str_replace("\n",'',str_replace('|','-',$director))))."|"; } else $csv_content.= "|"; if ( $plot != '' ) { $csv_content.= ltrim(rtrim(str_replace("\n",'',str_replace('|','-',substr($plot,0,strpos($plot,'#','\\1',$csv_content); $csv_content_clean = str_replace(' »','',str_replace('','',str_replace("
",'',$csv_preg_replace))); $csv_content = ''; fwrite($fh, $csv_content_clean."\r\n"); fclose($fh); } //gets the match content function get_match($regex,$content) { preg_match($regex,$content,$matches); return $matches[1]; } //gets the data from a URL function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $data = curl_exec($ch); curl_close($ch); return $data; } ?>