Handle shows without series and correctly affiliate title with title and series with series.

This commit is contained in:
Andrew Tomaka 2011-10-14 01:10:57 -04:00
parent ea4f928110
commit ac6516bad7
2 changed files with 5 additions and 5 deletions

View file

@ -22,7 +22,7 @@ $dataSources = array(
'lastfm' => 60, 'lastfm' => 60,
'sc2ranks' => 43200, 'sc2ranks' => 43200,
'steam' => 3600, 'steam' => 3600,
//'wow' => 43200, 'wow' => 43200,
); );
$cacheData = json_decode(file_get_contents($CACHE_FILE),true); $cacheData = json_decode(file_get_contents($CACHE_FILE),true);
@ -131,8 +131,8 @@ function hulu() {
preg_match('/<img src="(.*)" align="right"/',(string)$lastShow->description,$thumb); preg_match('/<img src="(.*)" align="right"/',(string)$lastShow->description,$thumb);
return array( return array(
'title' => $title[2], 'series' => isset($title[2]) ? $title[2] : 'Not Available',
'series' => $title[0], 'title' => $title[0],
'time' => strtotime($lastShow->pubDate), 'time' => strtotime($lastShow->pubDate),
'url' => (string)$lastShow->link, 'url' => (string)$lastShow->link,
'thumb' => $thumb[1], 'thumb' => $thumb[1],

View file

@ -111,8 +111,8 @@ $links = $db->query("SELECT id,url,text,status,released_date FROM wia_links WHER
</td> </td>
<td class="top"> <td class="top">
<span class="right"><a href="http://www.hulu.com/profiles/atomaka"><img src="img/badges/hulu.png" class="icon" alt="Hulu" /></a></span> <span class="right"><a href="http://www.hulu.com/profiles/atomaka"><img src="img/badges/hulu.png" class="icon" alt="Hulu" /></a></span>
<a href="<?php echo $data->hulu->url ?>"><?php echo $data->hulu->series ?></a><br/> <a href="<?php echo $data->hulu->url ?>"><?php echo $data->hulu->title ?></a><br/>
from <?php echo $data->hulu->title ?><br/><br/> from <?php echo $data->hulu->series ?><br/><br/>
<?php echo time_since($data->hulu->time) ?> ago<br/> <?php echo time_since($data->hulu->time) ?> ago<br/>
</td> </td>
</tr> </tr>