【问题标题】:Is there a movie showtime api? [closed]有电影放映时间API吗? [关闭]
【发布时间】:2010-10-01 04:34:39
【问题描述】:

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

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

【问题讨论】:

  • 有没有人为此发布一个实际的 api,比如 web 服务?我讨厌做屏幕抓取。我真的很想写一个电话或 ipad 应用程序,它有一个时间线,显示接下来 2 小时内附近播放的电影。没有网页以这种方式显示它,这通常是我希望看到的方式。 “接下来的几个小时我能看到什么节目?”如果我能得到数据,我很想写这个应用程序。有什么线索吗? JR

标签: api movies


【解决方案1】:

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

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

【讨论】:

  • 不幸的是,他们都没有 rss。使用像样的 html 解析器,抓取效果还不错。但我更担心违反服务条款而不是每隔一段时间更新一次代码。
【解决方案2】:

我找不到。

您可以尝试从 Yahoo Movies 进行屏幕抓取: http://movies.yahoo.com/showtimes/movie?z=60630&date=20090113&mid=1810038822

z    = zip code
date = year + month + day (as a string)
mid  = movieID, which you will have to grab from Yahoo Movies

【讨论】:

    【解决方案3】:

    不知道 Google 是否将其公开为 api,但这看起来很像您想要的。 http://www.google.com/movies?hl=en&near=90210&dq=movie+times+90210&sa=X&oi=showtimes&ct=title&cd=1

    【讨论】:

    • 感谢您的建议。我已经用python的beautifulsoup实现了一个屏幕抓取。但我想避免长期使用它,因为它明确违反了他们的服务条款。因此搜索受支持/记录在案的 api。
    • 此链接已被 Google 终止。对不起。
    【解决方案4】:

    抱歉,在发布问题之前应该再搜索一下。

    一些creative searching on del.icio.us 透露了一个无证的雅虎!电影 api (sample api call)。

    看起来不错。

    【讨论】:

      【解决方案5】:

      环顾一圈后,我发现 Dapper (open.dapper.net) 是创建此类提要的绝佳解决方案...

      这是我制作的提要,它以电影名称和邮政编码作为参数。 (大多数其他人只能通过 ZIP 搜索)

      http://www.dapper.net/dapp-howto-use.php?dappName=GoogleMoviesbynameANDzip

      设置大约需要 5 分钟...

      【讨论】:

      • Feed 已被 Google 屏蔽,此处不再可用
      【解决方案6】:

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

      【讨论】:

      • @Brook 在注册tmsdatadirect.com 时要求提供证书代码,注册时应该给出什么值?
      • 上面提到的那个无证的 YAHOO api 非常棒......我已经使用了一段时间......不幸的是,YAHOO 刚刚让它消失了(2009 年 11 月 4 日之后)......没有一些雅虎授权......而且看起来他们并没有给出这个! :((我希望上面的另一个想法对我有用)——托马斯
      • 雅虎只是删除了他们未记录的 API 吗?我无法再访问它,但我也找不到任何人在谈论它(删除)。
      • 链接已失效。
      • 仅限美国和加拿大 :-(
      【解决方案7】:

      我也在寻找可以合法抓取和重新发布的放映时间。雅虎听起来,如果您不出于商业目的这样做,则不会被禁止……或者这可能是我的一厢情愿。

      您同意不复制、复制、 复制、出售、交易、转售或利用 出于任何商业目的,任何 部分或使用,或访问, 雅虎!服务

      【讨论】:

        【解决方案8】:

        我也在寻找一个放映时间 API,和你一样,我还没有找到一个很好的电影放映时间 API。我决定基于 Google Showtimes 编写自己的“showtime API”。请检查一下。

        这是一个简单的 PHP 脚本,但“它做了它应该做的”:

            <?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.. 
         * 
         * 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
         */
        
        require_once('simple_html_dom.phps');
        
        $html = new simple_html_dom();
        $html->load_file('http://www.google.nl/movies?mid=&hl=en&near=1400AB');
        
        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 "\tMovie:    ".$movie->find('.name a',0)->innertext.'<br />';
                print "\tTime:    ".$movie->find('.times',0)->innertext.'<br />';
            }
            print "\n\n";
        }
        
        // clean up memory
        $html->clear();
        
        ?> 
        

        示例: http://code.basvd.nl/showtime_grabber_0.1/Google_showtime.php

        下载 simple_html_dom.php: http://code.basvd.nl/showtime_grabber_0.1/

        【讨论】:

        • 请注意,虽然它确实正确提取了 Google 的内容,但它完全违反了 Google 的服务条款。谨慎使用。
        【解决方案9】:

        当“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();
        ?>
        

        【讨论】:

        • 你是今天的英雄!非常感谢!
        • 说真的,如果可以的话+10!谷歌没有用于此的公共 API 真的太糟糕了:)
        • 不想听起来很讨厌,但是过去的记录呢?
        • 不存在了。谷歌删除了
        • 这已经死了。谷歌杀死了这个。
        【解决方案10】:
        http://www.google.com/ig/api?movies=YOUR_ZIP_HERE
        

        感谢尼克。这就是我将使用的链接。

        【讨论】:

        • 粘贴(修改)后在浏览器上查看源代码并回车。一个 xml 对象与孩子和您的电影列表一起存在。如果什么也没看到,请检查错误。
        • 这不起作用。每次都是相同的列表,只是更改了邮政编码。我猜它是 Google 内部用于测试目的的。
        • @henry74,这是一个 iGoogle API。它一次显示 3 个页面,这就是为什么它总是相同的响应。
        【解决方案11】:

        Fandango 似乎有 RSS 源,可让您搜索附近的电影。

        他们可以在这里找到:

        https://www.fandango.com/rss/moviefeed

        【讨论】:

        • 此链接似乎不再有效。
        • 我更新了链接
        • 在查看了您的更改后,我撤销了我之前的负面评论并赞成这个答案。
        【解决方案12】:

        不确定从中抓取 html 是否合法,但是,它是我发现的最干净的伪 API。 http://opensocial.flixster.com/igoogle/showtimes?date=20111025&postal=23226 - 用类似...的东西刮掉 html

        $('div.showtime', response).each(function() {
           // ... process each showtime div
        });
        

        【讨论】:

          【解决方案13】:

          我知道这有点老了。我认为目前还没有 api,但一些提供商确实提供了这项服务。我建议你看看西方世界媒体。

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 2010-09-26
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多