有电影showtime api吗?

71 api movies

有没有人知道任何(最好免费)支持api用于通过邮政编码访问电影放映时间?

我不相信任何现有的api,例如netflix或imdb,都提供此信息.

小智 16

当"allow_url_fopen"被禁用时,请使用

    <?php
/**
 * Google Showtime grabber
 * 
 * This file will grab the last showtimes of theatres nearby your zipcode.
 * Please make the URL your own! You can also add parameters to this URL: 
 * &date=0|1|2|3 => today|1 day|2 days|etc.. 
 * &start=10 gets the second page etc...
 * 
 * Please download the latest version of simple_html_dom.php on sourceForge:
 * http://sourceforge.net/projects/simplehtmldom/files/
 * 
 * @author Bas van Dorst <info@basvandorst.nl>
 * @version 0.1 
 * @package GoogleShowtime
 *
 * @modifyed by stephen byrne <gold.mine.labs@gmail.com>
 * @GoldMinelabs.com 
 */

require_once('simple_html_dom.php');

$curl = curl_init(); 
curl_setopt($curl, CURLOPT_URL, 'http://www.google.ie/movies?near=dublin');  
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);  
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);  
$str = curl_exec($curl);  
curl_close($curl);  

$html = str_get_html($str);

print '<pre>';
foreach($html->find('#movie_results .theater') as $div) {
    // print theater and address info
    print "Theate:  ".$div->find('h2 a',0)->innertext."\n";
    //print "Address: ". $div->find('.info',0)->innertext."\n";

    // print all the movies with showtimes
    foreach($div->find('.movie') as $movie) {
        print "Movie:    ".$movie->find('.name a',0)->innertext.'<br />';
        print "Time:    ".$movie->find('.times',0)->innertext.'<br />';
    }
    print "\n\n";
}

// clean up memory
$html->clear();
?>
Run Code Online (Sandbox Code Playgroud)


bro*_*oox 8

是的,雅虎显然在2009年11月删除了他们的秘密电影API.
似乎每个人都从TMS Data Direct获取他们的数据:http://www.tmsdatadirect.com/


toa*_*oad 7

不知道谷歌是否将它暴露为api,但这看起来很像你想要的. http://www.google.com/movies?hl=en&near=90210&dq=movie+times+90210&sa=X&oi=showtimes&ct=title&cd=1


use*_*650 0

我的猜测是,对此(除非这些人有 RSS 源)最好的选择是使用支持正则表达式的语言来抓取 HTML。

请注意,这很丑陋,每次他们更改代码时,您的代码都可能会崩溃。