update map service

This commit is contained in:
j 2007-08-04 09:31:05 +00:00
commit 47785eff62
7 changed files with 77 additions and 20 deletions

View file

@ -15,7 +15,8 @@ function movie2locations($id) {
$point = array();
$html = file_get_contents('http://imdb.com/title/tt' . $id . '/locations');
if (strlen($id) == 7)
$html = file_get_contents('http://imdb.com/title/tt' . $id . '/locations');
$string = explode('&&locations=', $html);
for ($i = 1; $i < count($string); $i++) {
@ -69,9 +70,11 @@ function movie2locations($id) {
// $locations_[$id] = $locations[$id];
// $locations = $locations_;
ksort($locations);
touch('data/locations.lock');
file_put_contents($file, serialize($locations));
unlink('data/locations.lock');
if (!file_exists('data/locations.lock')) {
touch('data/locations.lock');
file_put_contents($file, serialize($locations));
unlink('data/locations.lock');
}
}