diff --git a/lib/imdb/base.rb b/lib/imdb/base.rb index 34c5ca7..64d2f0c 100644 --- a/lib/imdb/base.rb +++ b/lib/imdb/base.rb @@ -151,7 +151,7 @@ def filming_locations # Returns alternative titles from imdb_url/releaseinfo def also_known_as - akas_document.search("#akas tr").map { |aka| + releaseinfo_document.search("#akas tr").map { |aka| { :version => aka.search("td:nth-child(1)").text, :title => aka.search("td:nth-child(2)").text @@ -170,8 +170,8 @@ def locations_document @locations_document ||= Nokogiri::HTML(Imdb::Movie.find_by_id(@id, "locations")) end - def akas_document - @akas_document ||= Nokogiri::HTML(Imdb::Movie.find_by_id(@id, "releaseinfo")) + def releaseinfo_document + @releaseinfo_document ||= Nokogiri::HTML(Imdb::Movie.find_by_id(@id, "releaseinfo")) end # Use HTTParty to fetch the raw HTML for this movie. diff --git a/spec/fixtures/plotsummary b/spec/fixtures/plotsummary index 1b23b3b..f78b252 100644 --- a/spec/fixtures/plotsummary +++ b/spec/fixtures/plotsummary @@ -1,13 +1,13 @@ HTTP/1.1 200 OK -Date: Fri, 31 Jan 2014 10:08:08 GMT +Date: Fri, 31 Jan 2014 11:25:40 GMT Server: Server X-Frame-Options: SAMEORIGIN Content-Type: text/html;charset=UTF-8 Content-Language: en-US Vary: Accept-Encoding,User-Agent -Set-Cookie: uu=BCYjyTUQu6x2yLfoettgqVT0OkjyhJurUKGHeXaEItnwobv6osmlUhMvGPJrdDdVAjORIiG7HvZa%0D%0AttsHW26O63C4m_yF1-Rye_CLzF4ALT0l284i6eT46k9eHC_WdmyidkcvXnRU_9vjMsuW54q8h8sh%0D%0AOP3wer7FHZWrOCDr85_uOVfS5Dl8K_GuJVyUQL1_PZ_f5uVLSWKCflo8q7sHPl7pSOLYjF6XTcTJ%0D%0ACNpdWSzXI_R-USVDX0Y7jT6NC_A8Lbwfy-CqrzOo4iJ5FgtnAK3pFw%0D%0A; Domain=.imdb.com; Expires=Wed, 18-Feb-2082 13:22:15 GMT; Path=/ -Set-Cookie: session-id=000-0000000-0000000; Domain=.imdb.com; Expires=Wed, 18-Feb-2082 13:22:15 GMT; Path=/ -Set-Cookie: session-id-time=1548842888; Domain=.imdb.com; Expires=Wed, 18-Feb-2082 13:22:15 GMT; Path=/ +Set-Cookie: uu=BCYtrnd-r5Ep5YoFDrX6xKjHRR87f6Q-pL3lu07YvSfNAR7bI4GQewKpefcHoE61xhww3J1slN7A%0D%0AkdhydLQUYJvRR2yRUxwroyENmSPKWjX4y5VBOcCQ85lWEO8FiREt1rXu_zIN3DYV00r6zT24tdTD%0D%0AZ5wqpzdzfqNpiCy3YtMKoq3x-nXSP6dndqqqOBT9WC-rab5z4lW-6iC-svpmze21ZFfy3WOBq64t%0D%0AO6j8L4janQSxRsQT1irJoxmuKL6WeW9n_wePY9Nkx9kA91BXKeBBKg%0D%0A; Domain=.imdb.com; Expires=Wed, 18-Feb-2082 14:39:47 GMT; Path=/ +Set-Cookie: session-id=000-0000000-0000000; Domain=.imdb.com; Expires=Wed, 18-Feb-2082 14:39:47 GMT; Path=/ +Set-Cookie: session-id-time=1548847540; Domain=.imdb.com; Expires=Wed, 18-Feb-2082 14:39:47 GMT; Path=/ P3P: policyref="http://i.imdb.com/images/p3p.xml",CP="CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC " Transfer-Encoding: chunked @@ -32,7 +32,7 @@ xmlns:fb="http://www.facebook.com/2008/fbml"> var ue_sn = "www.imdb.com"; var ue_furl = "fls-na.amazon.com"; var ue_sid = "000-0000000-0000000"; - var ue_id = "1B92NE0W07R82T9HW5PC"; + var ue_id = "173PREXW0B6WV067R493"; (function(e){var c=e,a={main_scope:"mainscopecsm",q:[],t0:c.ue_t0||+new Date(),d:g};function g(h){return +new Date()-(h?0:a.t0)}function d(h){return function(){a.q.push({n:h,a:arguments,t:a.d()})}}function b(k,j,h){var i={m:k,f:j,l:h,fromOnError:1,args:arguments};c.ueLogError(i);return false}b.skipTrace=1;e.onerror=b;function f(){c.uex("ld")}if(e.addEventListener){e.addEventListener("load",f,false)}else{if(e.attachEvent){e.attachEvent("onload",f)}}a.tag=d("tag");a.log=d("log");a.reset=d("rst");c.ue_csm=c;c.ue=a;c.ueLogError=d("err");c.ues=d("ues");c.uet=d("uet");c.uex=d("uex");c.uet("ue")})(window);(function(e,d){var a=e.ue||{};function c(g){if(!g){return}var f=d.head||d.getElementsByTagName("head")[0]||d.documentElement,h=d.createElement("script");h.async="async";h.src=g;f.insertBefore(h,f.firstChild)}function b(){var k=e.ue_cdn||"z-ecx.images-amazon.com",g=e.ue_cdns||"images-na.ssl-images-amazon.com",j="/images/G/01/csminstrumentation/",h=e.ue_file||"ue-full-ef584a44e8ea58e3d4d928956600a9b6._V1_.js",f,i;if(h.indexOf("NSTRUMENTATION_FIL")>=0){return}if("ue_https" in e){f=e.ue_https}else{f=e.location&&e.location.protocol=="https:"?1:0}i=f?"https://":"http://";i+=f?g:k;i+=j;i+=h;c(i)}if(!e.ue_inline){b()}a.uels=c;e.ue=a})(window,document); @@ -67,10 +67,10 @@ xmlns:fb="http://www.facebook.com/2008/fbml"> - + - + @@ -266,17 +266,17 @@ onsubmit="(new Image()).src='/rg/SEARCH-BOX/HEADER/images/b.gif?link=/find';"
  • 'Neighbors' with Seth Rogen, 'Space Station 76,' more join SXSW features lineup
    - 14 hours ago + 15 hours ago
  • Oscars: Michael B. Jordan, Kristen Bell to Host Sci-Tech Awards
    - 15 hours ago + 16 hours ago
  • Jerry Seinfeld Sorta Confirms Seinfeld Reunion, Gives Details on Secret Project With Jason Alexander
    - 16 hours ago + 17 hours ago
  • @@ -679,7 +679,7 @@ John McClane, a detective with the New York City Police Department, arrives in L

    TV

    @@ -1082,7 +1082,7 @@ jQuery(document).ready(function(){ ); -
    +
    diff --git a/spec/fixtures/releaseinfo b/spec/fixtures/releaseinfo new file mode 100644 index 0000000..9b9db39 --- /dev/null +++ b/spec/fixtures/releaseinfo @@ -0,0 +1,1413 @@ +HTTP/1.1 200 OK +Date: Fri, 31 Jan 2014 11:25:40 GMT +Server: Server +X-Frame-Options: SAMEORIGIN +Content-Type: text/html;charset=UTF-8 +Content-Language: en-US +Vary: Accept-Encoding,User-Agent +Set-Cookie: uu=BCYgjePVtSFb0IjQryNnCssuGM6lYsVkCDZzOZkwDphc5TyBhg_DuxL09-a_55xTPiQqepYH-dgl%0D%0AEI3VXiAHt5cBA2-odDN2j2vM_jKdk6nyiL9MdQuCNgTktLRequS9PHl5JyP2kfYMuumpP0_6ch2y%0D%0Aoh_nupdgzjSfIydE7aPeEsmrTs1bvI-672dYc42fyXn9EFtTKyM3BerpTyuANIZ24wwkfyBM3LuE%0D%0AczbVAYpa_7i1V150nwDzSjPjRgTSo6Sbi-COyK36RMydx--FcMwr7Q%0D%0A; Domain=.imdb.com; Expires=Wed, 18-Feb-2082 14:39:48 GMT; Path=/ +Set-Cookie: session-id=000-0000000-0000000; Domain=.imdb.com; Expires=Wed, 18-Feb-2082 14:39:48 GMT; Path=/ +Set-Cookie: session-id-time=1548847541; Domain=.imdb.com; Expires=Wed, 18-Feb-2082 14:39:48 GMT; Path=/ +P3P: policyref="http://i.imdb.com/images/p3p.xml",CP="CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC " +Transfer-Encoding: chunked + + + + + + + + + + + + + + + + + + + + + + + + Die Hard (1988) - Release Info - IMDb + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + +
    + + + + +
    +
    +
    + + Edit + +
    + +
    +

    + + (1988) + +

    +
    + +

    Release Info

    +
    +
    +
    +
    +Jump to: +Release Dates (34) | +Also Known As (AKA) (32)
    +
    + +

    Release Dates 

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    USA15 July 1988 (limited)
    USA22 July 1988
    France21 September 1988
    South Korea24 September 1988
    Philippines27 September 1988 (Davao)
    Spain30 September 1988
    Sweden30 September 1988
    Australia6 October 1988
    Finland7 October 1988
    Hong Kong19 October 1988
    Netherlands3 November 1988
    Greece10 November 1988
    West Germany10 November 1988
    Austria11 November 1988
    Norway18 November 1988
    UK27 November 1988 (London Film Festival)
    Argentina15 December 1988
    Portugal16 December 1988
    Brazil22 December 1988
    El Salvador25 December 1988
    Uruguay25 December 1988
    Denmark26 December 1988
    Poland6 January 1989
    Peru2 February 1989
    UK3 February 1989
    Japan4 February 1989
    Ireland3 March 1989
    Colombia20 April 1989
    Italy23 June 1989
    Hungary14 December 1989
    Turkey26 January 1990
    Czechoslovakia20 June 1991
    France28 January 2010 (Gerardmer International Fantasy Film Festival)
    Canada9 February 2010 (Digital Film Festival)
    + +

    Also Known As (AKA) 

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    (original title)Die Hard
    ArgentinaDuro de matar
    AustriaStirb langsam
    Bulgaria (Bulgarian title)Умирай трудно
    BrazilDuro de Matar
    Canada (French title)Piège de cristal
    Czechoslovakia (Slovak title)Smrtonosná pasca
    CzechoslovakiaSmrtonosná past
    Czechoslovakia (Czech title)Smrtonosná past
    Czech RepublicSmrtonosná past
    DenmarkDie Hard
    EstoniaVisa hing
    SpainJungla de cristal
    Finland (alternative title)Die hard - vain kuolleen ruumiini yli
    Finland (Swedish title)Med dödlig påföljd
    FinlandVain kuolleen ruumiini yli
    FrancePiège de cristal
    Greece (transliterated ISO-LATIN-1 title)Poly skliros gia na pethanei
    GreeceΠολύ Σκληρός για να Πεθάνει
    CroatiaUmri muški
    HungaryDrágán add az életed!
    Italy (pre-release title)A un passo dall'inferno - Trappola di cristallo
    Italy (DVD title)Die Hard - Trappola di cristallo
    ItalyTrappola di cristallo
    Japan (English title)Die Hard
    LithuaniaKietas riesutelis
    MexicoDuro de matar
    Norway (alternative title)Aksjon skyskraper
    PeruDuro de matar
    PolandSzklana pulapka
    PortugalAssalto ao Arranha-Céus
    RomaniaGreu de Ucis
    RomaniaGreu de ucis
    SerbiaUmri muški
    RussiaКрепкий орешек
    SloveniaUmri pokoncno
    Turkey (Turkish title)Zor Ölüm
    UruguayDuro de matar
    West GermanyStirb langsam
    Yugoslavia (Serbian title)Umri muski
    +
    +
    + + + +
    +

    See also

    +

    + +Full Cast and Crew +| +Official Sites +| +Box Office/Business +| +Company Credits +| +Filming Locations +| +Technical Specs +| +Literature +

    +
    + + + +
    + +

    Contribute to This Page

    + +
    +
    + + +
    +
    + + + + + + + +
    + + + +
    + + + + +
    + +
    +
    + +
    +
    + + + + + + +
    +
    + + + + + + + +
    + + + + + + + diff --git a/spec/imdb/movie_spec.rb b/spec/imdb/movie_spec.rb index 93c9376..3c853bd 100644 --- a/spec/imdb/movie_spec.rb +++ b/spec/imdb/movie_spec.rb @@ -182,8 +182,12 @@ it "should find multiple 'also known as' versions" do also_known_as = @movie.also_known_as also_known_as.should be_an(Array) - also_known_as.size.should eql(37) - also_known_as[11].should == {:version => "Finland (alternative title)", :title => "Die hard - vain kuolleen ruumiini yli"} + also_known_as.size.should eql(40) + end + + it "should find a specific 'also known as' version" do + also_known_as = @movie.also_known_as + also_known_as.should include({ version: "Russia", title: "Крепкий орешек"}) end it "should provide a convenience method to search" do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7eee1bd..686ec62 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -27,6 +27,7 @@ def read_fixture(path) "http://akas.imdb.com/title/tt0095016/synopsis" => "synopsis", "http://akas.imdb.com/title/tt0095016/plotsummary" => "plotsummary", "http://akas.imdb.com/title/tt0095016/locations" => "locations", + "http://akas.imdb.com/title/tt0095016/releaseinfo" => "releaseinfo", "http://akas.imdb.com:80/title/tt0242653/combined" => "tt0242653", "http://akas.imdb.com/title/tt0166222/?fr=c2M9MXxsbT01MDB8ZmI9dXx0dD0xfG14PTIwfGh0bWw9MXxjaD0xfGNvPTF8cG49MHxmdD0xfGt3PTF8cXM9SSBraWxsZWQgbXkgbGVzYmlhbiB3aWZlfHNpdGU9YWthfHE9SSBraWxsZWQgbXkgbGVzYmlhbiB3aWZlfG5tPTE_;fc=1;ft=7" => "tt0166222", "http://akas.imdb.com:80/chart/top" => "top_250",