graham23s
09-03-2007, 08:34 AM
Hi Guys,
for a type of review site i was wanting to get the average votes for a movies and then display it on my site, the site is imdb, just the number of votes i was trying to get
i have so far:
<?php
//=====================================================================================//
// IMDB get rating...
//=====================================================================================//
$str_text = file_get_contents("http://www.imdb.com/title/tt0373883/");
$pattern = '/(h1|src)=[\'"]/';
preg_match_all($pattern, $str_text, $matches);
echo "<pre>";
var_dump($matches);
echo "</pre>";
?>
in imdb the rating is in this code:
</div>
<div class="general rating">
<div class="starbar static"><div class="outer"><div class="inner" style="width: 64px"></div></div></div>
<b>User Rating:</b>
<b>3.2/10</b>
<small>(<a href="ratings">323 votes</a>)</small>
<div class="bottom">
so many spans in the code not sure how to set up the reg ex any help would be appreciated
Graham
for a type of review site i was wanting to get the average votes for a movies and then display it on my site, the site is imdb, just the number of votes i was trying to get
i have so far:
<?php
//=====================================================================================//
// IMDB get rating...
//=====================================================================================//
$str_text = file_get_contents("http://www.imdb.com/title/tt0373883/");
$pattern = '/(h1|src)=[\'"]/';
preg_match_all($pattern, $str_text, $matches);
echo "<pre>";
var_dump($matches);
echo "</pre>";
?>
in imdb the rating is in this code:
</div>
<div class="general rating">
<div class="starbar static"><div class="outer"><div class="inner" style="width: 64px"></div></div></div>
<b>User Rating:</b>
<b>3.2/10</b>
<small>(<a href="ratings">323 votes</a>)</small>
<div class="bottom">
so many spans in the code not sure how to set up the reg ex any help would be appreciated
Graham