영화 상영 시간 API가 있나요?
우편 번호로 영화 상영 시간에 액세스하기 위해 지원되는 (가급적 무료) API를 아는 사람이 있습니까?
netflix 또는 imdb와 같은 기존 API가이 정보를 제공한다고 생각하지 않습니다.
"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();
?>
예, Yahoo는 2009 년 11 월에 비밀 영화 API를 제거한
것으로 보입니다. 모든 사람이 TMS Data Direct에서 데이터를 가져 오는 것 같습니다 : http://www.tmsdatadirect.com/
구글이 그것을 api로 노출하는지는 모르지만 이것은 당신이 원하는 것과 매우 흡사합니다. http://www.google.com/movies?hl=ko&near=90210&dq=movie+times+90210&sa=X&oi=showtimes&ct=title&cd=1
죄송합니다. 질문을 게시하기 전에 좀 더 검색 했어야했습니다.
일부 del.icio.us에 창조적 인 검색은 문서화되지 않은 야후를 공개했다! 영화 API ( 샘플 API 호출 ).
좋아 보인다.
잠시 둘러 본 후 Dapper (open.dapper.net)가 이러한 유형의 피드를 만드는 데 훌륭한 솔루션이라는 것을 알았습니다.
여기 내가 만든 피드는 영화 제목과 우편 번호를 매개 변수로 사용합니다. (대부분의 경우 ZIP으로 만 검색 가능)
http://www.dapper.net/dapp-howto-use.php?dappName=GoogleMoviesbynameANDzip
설정하는 데 5 분 정도 걸렸습니다 ...
나도 합법적으로 긁어 내고 다시 게시 할 수있는 상영 시간을 찾고 있습니다. 야후는 상업적인 목적으로하지 않으면 금지되지 않는 것처럼 들리거나 어쩌면 내 쪽에서 바라는 생각 일 수도 있습니다.
You agree not to reproduce, duplicate, copy, sell, trade, resell or exploit for any commercial purposes, any portion or use of, or access to, the Yahoo! Services
Fandango seems to have RSS feeds that allow you to search for movies near you.
http://www.fandango.com/rss/moviefeed
Not sure if it's legal to scrape the html from this, but, it's the cleanest pseudo-API I've found. http://opensocial.flixster.com/igoogle/showtimes?date=20111025&postal=23226 - just scrape the html with something like...
$('div.showtime', response).each(function() {
// ... process each showtime div
});
My guess is that your best bet on that (unless these guys have RSS feeds) would be to scrape the HTML with a language that supports regular expressions.
Mind you, that's ugly and every time they change their code, yours -could- break.
I can't find one.
You could try screen-scraping from 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
I was also looking for a showtime API, and like you, I have not found a good API for the movie showtimes. I decided to write my own "showtime API", based on the Google Showtimes. Please check it out.
It is a simple PHP-script, but "it does what it should do":
<?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();
?>
Example: http:// code.basvd.nl/showtime_grabber_0.1/Google_showtime.php
Download simple_html_dom.php: http:// code.basvd.nl/showtime_grabber_0.1/
I know this is a bit old. I don't think there is an api for this yet but some providers do offer this service. I suggest you look at West World Media.
http://www.google.com/ig/api?movies=YOUR_ZIP_HERE
Thanks to Nick. that's the link I will be using.
참고URL : https://stackoverflow.com/questions/439857/is-there-a-movie-showtime-api
'Nice programing' 카테고리의 다른 글
REST 기반 서비스를 사용하기위한 Generic Python 라이브러리가 있습니까? (0) | 2020.11.02 |
---|---|
g ++로 컴파일되는 이상한 코드 (0) | 2020.11.02 |
HashMap.clear ()에서 Arrays.fill ()이 더 이상 사용되지 않는 이유는 무엇입니까? (0) | 2020.11.02 |
OS X의 경로에서 / usr / bin 전에 / usr / local / bin을 갖는 데 문제가 있습니까? (0) | 2020.11.02 |
완전한 Cocos2d-x 튜토리얼 및 가이드 목록 (0) | 2020.11.02 |