update map service
This commit is contained in:
parent
4d4f794fd0
commit
47785eff62
7 changed files with 77 additions and 20 deletions
|
|
@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue