Assembla home | Assembla project page
 

Changeset 1093

Show
Ignore:
Timestamp:
10/05/08 19:04:59 (2 months ago)
Author:
Pernod
Message:

Updated epguides parser due to page layout changes at tv.com.

Minor changes to TVDB parser. Now defaults to thetvdb.com if the mirrors.xml failed to download.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/swisscenter/ext/parsers/tv/www.TheTVDB.com.php

    r1054 r1093  
    1616 
    1717   Please help thetvdb.com website by contributing information and artwork if possible. 
    18  
    19    NOTE: This parser for thetvdb.com is _NOT_ an official part of SWISScenter, and is not supported by the 
    20    SWISScenter developers. 
    2118    
    2219   Version history: 
     
    9390        { 
    9491          // Zip extension not loaded so download non-zipped data 
    95           send_to_log(4,'Downloading remote file to the local filesystem',$series_xml_url); 
    96           if (!@copy($series_xml_url, $series_cache)) 
    97             send_to_log(6,'Failed to copy remote file to',$series_cache); 
    98           send_to_log(4,'Downloading remote file to the local filesystem',$banner_xml_url); 
    99           if (!@copy($banner_xml_url, $banner_cache)) 
    100             send_to_log(6,'Failed to copy remote file to',$banner_cache); 
    101 //          send_to_log(4,'Downloading remote file to the local filesystem',$actors_xml_url); 
    102 //          if (!@copy($actors_xml_url, $actors_cache)) 
    103 //            send_to_log(6,'Failed to copy remote file to',$actors_cache); 
     92          file_download_and_save($series_xml_url, $series_cache, true); 
     93          file_download_and_save($banner_xml_url, $banner_cache, true); 
     94//          file_download_and_save($actors_xml_url, $actors_cache, true); 
    10495        } 
    10596        else 
    10697        { 
    107           send_to_log(4,'Downloading remote file to the local filesystem',$series_zip_url); 
    108           if (!@copy($series_zip_url, $series_zip_cache)) 
    109             send_to_log(6,'Failed to copy remote file to',$series_zip_cache); 
    110           else 
     98          file_download_and_save($series_zip_url, $series_zip_cache, true); 
     99          if (file_exists($series_zip_cache)) 
    111100          { 
    112101            // Extract zip contents 
     
    297286    $xmlmirror = $xmlmirrors[rand(0, count($xmlmirrors)-1)]; 
    298287  else 
    299     $xmlmirror = false
     288    $xmlmirror = 'http://thetvdb.com'
    300289 
    301290  if (count($bannermirrors)>0) 
    302291    $bannermirror = $bannermirrors[rand(0, count($bannermirrors)-1)]; 
    303292  else 
    304     $bannermirror = false
     293    $bannermirror = 'http://thetvdb.com'
    305294} 
    306295 
  • trunk/swisscenter/ext/parsers/tv/www.epguides.com.php

    r957 r1093  
    2424   28-Jan-2008: v1.2:     Encoded URL containing Programme name and improved search and error handling. 
    2525   04_Mar-2008: v1.3:     Minor fixes to url and episode searching. 
     26   26-Sep-2008: v1.4:     Fixed for new layout at TV.com (synopsis and date).  Fixes by Keith Solomon. 
    2627 
    2728 *************************************************************************************************/ 
     
    182183          send_to_log(6,'Fetching information from: '.$url_load); 
    183184          $html = file_get_contents( $url_load ); 
    184                  
     185 
    185186          // Year 
    186           $year  = substr_between_strings($html,'First Aired:','&nbsp'); 
     187          $year  = substr_between_strings($html,'First Aired:','</li></ul>'); 
    187188          $year  = substr($year,strlen($year)-4); 
    188189 
    189190          // Synopsis 
    190           $start = strpos($html,'<div id="main-col">'); 
    191           $end = strpos($html,'class="ta-r mt-10 f-bold">',$start+1); 
     191          $start = strpos($html,'<div id="indepth_block" class="module">'); 
     192          $end = strpos($html,'</a></p>',$start+1); 
    192193          $html_synopsis = substr($html,$start,$end-$start); 
    193           $start = strrpos_str($html_synopsis,'div>'); 
     194          $start = strrpos_str($html_synopsis,'<p class="deck">'); 
    194195          $html_synopsis = substr($html_synopsis,$start); 
    195           $synopsis_ep  = substr_between_strings($html_synopsis,'div>','<div'); 
     196          $synopsis_ep  = substr_between_strings($html_synopsis,'deck">','<a href='); 
    196197 
    197198          // Director(s) 
     
    273274             
    274275            // Year 
    275             $year  = substr_between_strings($html,'First Aired:','&nbsp'); 
     276            $year  = substr_between_strings($html,'First Aired:','</li></ul>'); 
    276277            $year  = substr($year,strlen($year)-4); 
    277278   
    278279            // Synopsis 
    279             $start = strpos($html,'<div id="main-col">'); 
    280             $end = strpos($html,'class="ta-r mt-10 f-bold">',$start+1); 
     280            $start = strpos($html,'<div id="indepth_block" class="module">'); 
     281            $end = strpos($html,'</a></p>',$start+1); 
    281282            $html_synopsis = substr($html,$start,$end-$start); 
    282             $start = strrpos_str($html_synopsis,'div>'); 
     283            $start = strrpos_str($html_synopsis,'<p class="deck">'); 
    283284            $html_synopsis = substr($html_synopsis,$start); 
    284             $synopsis_ep  = substr_between_strings($html_synopsis,'div>','<div'); 
    285    
     285            $synopsis_ep  = substr_between_strings($html_synopsis,'deck">','<a href='); 
     286 
    286287            // Director(s) 
    287288            $start = strpos($html,"Director:");