blog.humaneguitarist.org

discoveries in digital audio, music notation, and information encoding

Archive for the ‘HammerFlix’ tag

HammerFlicks and the Netflix API … in the grave?

leave a comment

Well, I've noticed some of the results from HammerFlicks have seemed a little off lately. So I stumbled upon this in regard to the Netflix API:

The following are the changes we are making to the program, all of which are effective immediately (except where otherwise noted):

  • We will no longer issue new public API developer keys.  All existing keys that are actively calling the API will remain active.
  • We will no longer accept new API affiliates.  There will be no impact to existing and active affiliates.
  • We will no longer offer test environments.  The test tools have been unavailable for a while and we won’t bring them back.
  • We will set the forums in the developer portal to read-only.  We encourage developers to continue their conversations at StackOverflow with the tag “netflixapi”.  The existing forum posts will remain on the site for now in the form of an archive.
  • We will retire the OData catalog, effective on April 8, 2013.

source: Netflix API : Changes to the Public API Program. Retrieved May 09, 2013, from developer.netflix.com/blog/read/Changes_to_the_Public_API_Program

Sounds like it might be time to retire HammerFlicks … or at least issue a disclaimer. What's strange is that I didn't receive an email about these changes, whereas I seemed to have gotten email notification of previous API changes. Oh well, business priorities change and Netflix isn't obligated to give away their data.

Update, May 26, 2013: Well, perhaps there are less Hammer films on Netflix because Hammer now has its own YouTube channel.

--------------

Related Content:

Written by nitin

May 9th, 2013 at 8:41 am

Posted in film,news

Tagged with ,

HammerFlicks and pOAIndexter source codes available

leave a comment

Quickie:

I've made the source code available for HammerFlicks (click on the "Source Code" link) and "pOAIndexter" (scroll down to "pOAIndexter").

The "pOIAndexter" scripts is used to drive the metadata harvesting for NC ECHO.

I seriously doubt anyone else will download/use these, but making them downloadable forces me to do a decent job – I hope – of being organized.

--------------

Related Content:

Written by nitin

March 31st, 2013 at 2:52 pm

Posted in news,scripts

Tagged with , ,

HammerFlix 3: Village of the DOMed

leave a comment

Update, November 27, 2011: If you're looking for a live list of Hammer Films streaming on Netflix you can see it here.

To read more about the HammerFlicks project, click here.

Grrr. Obsession is a good ally for creativity, but it's still annoying.

I woke up today and decided to have a decent breakfast and do some very light work on HammerFlix – a small project to use the Netflix API to discover which Hammer Films movies are available on Netflix's Watch Instantly.

Basically, I just added some buttons/Javascript that will allow one to filter out the non-matches, show only Hammer films that HammerFlix thinks are on Netflix, or show only the ones that are apparently available for streaming.

Sure, there's still some work to be done to improve the reliability of the results as I mentioned yesterday, but I'm not too worried about it for now.

If you're wondering why the search for "The House Across the Lake" from 1954 shows "Them!" as a streaming match it's because "The House Across the Lake" isn't on Netflix and "Them!" is the first match the API returns. In this case, both movies happen to share 1954 as the release year. Currently, if HammerFlix sees that the first API returned result matches the release year, it reports the movie as available on Netflix. So, I need to make it a little smarter than that, but not this weekend.

Anyway, you can see the latest results here.

Dorks can view the source files in this folder. The best thing in there is the MIT license generated by the Spiteful Open Source License Generator.

:P

No more coding this weekend … time for a long walk sans electronics.

Update: OK, so I lied. I couldn't resist. I just added a score for how reliable the match is.

Go here to see the HammerFlix results from about 10pm EST tonight. on September 26, 2011.

There's now a "match score" under each thing HammerFlix claims is on Netflix. This is done by comparing the title from the Wikipedia filmography against the "short" and "regular" titles from the Netflix API XML result (i.e. two scores). I used the PHP similar_text() function to get the score for each and then averaged them for the "match score".

There's occasionally a PHP "undefined offset" error for a couple of films. That's no big deal and I'll fix it later by just making sure I test for some stuff before printing to screen. But it seems to work pretty well. The "The House Across the Lake"  vs. "Them!" mismatch only gets a 20% rating, so that tells me it might not actually be the same movie.

And as a reward, I'm watching "To the Devil, a Daughter" now …

--------------

Related Content:

Written by nitin

September 25th, 2011 at 11:00 am

Posted in scripts

Tagged with ,

in the can: another HammerFlix update

leave a comment

Update, November 27, 2011: If you're looking for a live list of Hammer Films streaming on Netflix you can see it here.

To read more about the HammerFlicks project, click here.

Last night while streaming Star Trek: TOS on NetFlix or Qwikster or whatever, I finished up this Python file around 3am that makes this semicolon delimited file of Hammer Films and their production year if you throw it at a local copy of this Wikipedia/Hammer Films filmography page.

Had enough of "this"? Well, there's more where that, I mean this, came from.

So, I woke up at about 9am and worked on this PHP version on HammerFlix.

And finally, about 12 hours after going to bed, I've got this list of Hammer Films on Netflix and whether they stream or not.  I should mention that I tested with both the "UK" and "US" versions of the titles if both were present in Wikipedia, so there are a few duplicate items in the list.

Eventually, I'll make the PHP file clickable so anyone can run it and get a current report. But as of right now, I've used up all my Netflix API allowance for the day.

Now, as I mentioned in this post I was only testing to see if a movie title and its production year matched the Wikipedia filmography data in order to determine if the movie was available on Netflix and whether it streamed.

Testing that way isn't perfect. For example, the Wikipedia page lists 2011 as the year for "The Woman in Black" but IMDB and Netflix say it's 2012. So that movie isn't reported correctly by HammerFlix.

I'm noticing a few other things, too, but I'll work on it later. Seriously, I need to get on with my weekend …

Maybe I'll watch a Hammer film tonight!

--------------

Related Content:

Written by nitin

September 24th, 2011 at 3:24 pm

Posted in scripts

Tagged with , ,

a HammerFlix update

leave a comment

Update, November 27, 2011: If you're looking for a live list of Hammer Films streaming on Netflix you can see it here.

To read more about the HammerFlicks project, click here.

Principal photography has begun on HammerFlix – a small project to use the Netflix API to discover which Hammer Films movies are available on Netflix's Watch Instantly.

So far, I've got a PHP file that has two functions.

The first one, named Igor, takes two arguments: a movie title and its release year. Igor then sends this to the Netflix API and retrieves only the first result for searching against that given title. Then Igor sends the XML version of the API results to another function, Master.

Master, aka Dr. Frankenstein, then evaluates the result. If the Netflix release date for the movie returned by the API matches the year value sent to Igor, then Master will display the link to that movie on Netflix. If the movie is available via Watch Instantly, Master will also display the link to the streaming movie. If the year doesn't match, Master reports that no results were found.

Testing against just the first match and using release year as the only qualifier might not be the best, but I think it might work pretty decently. If not, I'll have Igor retrieve more results and then Master can evaluate more results and use more test criteria before assuming the movie isn't on Netflix.

The next step is to get all the Hammer titles from the Hammer Filmography on Wikipedia and send each title and release year to HammerFlix. There might be some open/linked data opportunities later down the road with dbPedia, but that's not important for now.

You can see this very basic test of HammerFlix 0.01 here.

Anyway, here's the code for the development version of 0.01.

<?php

//Igor does the hard work of hitting up the Netflix API for movies matching $title.
//The code is mainly from: http://developer.netflix.com/page/resources/sample_php
function Igor($title, $year) {

    include ('../authentication/myAPI.php'); //this includes my Netflix API key and shared secret as $apiKey and $sharedSecret.

    //build stuff to send to API.
    $arguments = Array(
        'term' => $title,
        'expand' => 'formats',
        'max_results' => '1',
        'output' => 'xml'
    );

    $path = "http://api.netflix.com/catalog/titles";
    $oauth = new OAuthSimple();
    $signed = $oauth->sign(Array('path' => $path,
                'parameters' => $arguments,
                'signatures' => Array('consumer_key' => $apiKey,
                    'shared_secret' => $sharedSecret
                    )));

    //hit up API via CURL.
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $signed['signed_url']);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    //curl_setopt($curl, CURLOPT_SETTIMEOUT, 2); //Nitin commented this out on 2/5/2011 to prevent a PHP error message.
    $buffer = curl_exec($curl);
    if (curl_errno($curl)) {
        die("An error occurred:" . curl_error());
    }

    Master($buffer, $title, $year); //send XML results to Master().
}

//Master (Dr. Frankenstein) parses/returns the Netflix XML results retrieved by Igor.
function Master($buffer, $title, $year) {

    $xml = simplexml_load_string($buffer);
    $movieInfo = ($xml->catalog_title);
    $short = "short";
    $movieTitle_short = ($movieInfo->title->attributes()->$short);
    $regular = "regular";
    $movieTitle_regular = ($movieInfo->title->attributes()->$regular);
    $movieLink = ($movieInfo->id);
    $movieId = str_replace("http://api.netflix.com/catalog/titles/movies/", "", $movieLink);
    $movieYear = ($movieInfo->release_year);

    //test if movie is available for Watch Instantly/streaming.
    $streaming = $xml->xpath('//availability/category/@label');
    foreach ($streaming as $instantTest) {
        if ($instantTest == 'instant') {
            $streams = '';
        }
    }

    //output findings.
    echo "<li><p>Testing:<em> " . $title . " </em>from the year:<em> " . $year . "</em><br />";
    if ($movieYear == $year) {
        echo "<a href='http://movies.netflix.com/WiMovie/" . $movieId . "'>" . $movieTitle_short . "</a>";

        //IT'S ALIVE!!!
        //aka: show user the Watch Instantly link if it exists.
        if (isset($streams)) {
            echo "<br /><strong><a href='http://movies.netflix.com/WiPlayer?movieid=" . $movieId . "'>Watch Instantly</a></strong>";
        }
    } else {
        echo "No match.";
    }
    echo "</p></li>";
}

//Create life!
//aka: start doing things.
include ('../authentication/OAuthSimple.php');

echo "<ul>"; //put results in unordered list; send arguments to Igor().
Igor("The Brides of Dracula", "1960");
Igor("The Brides of Dracula", "1961");
Igor("Dracula Has Risen from the Grave", "1968");
Igor("Vampire Circus", "1972");
echo "</ul>";
?>
--------------

Related Content:

Written by nitin

September 10th, 2011 at 1:16 pm

Posted in scripts

Tagged with ,

HammerFlix 2: Terror of the lost API Keys

leave a comment

Update, November 27, 2011: If you're looking for a live list of Hammer Films streaming on Netflix you can see it here.

To read more about the HammerFlicks project, click here.

So, like six months ago I posted about an idea involving the Netflix API and trying to get a list of Hammer horror films available for streaming.

The good news is I've decided to carve out some time each Saturday and actually make this into a little pet project.

The bad news is that in editing the information about my app, I accidentally deleted my API keys and have to wait … and wait … on the news ones getting approved, which apparently is a process experiencing some delays lately.

Bummer.

Anyway, there are some interesting things that have happened since last time.

  1. The Netflix API is now totally about the Watch Instantly (streaming) catalog. See here.
  2. This PHP code example of hitting up the API which used to work out of the box now seems to require that I surround the keys like "term" and "output" with quotation marks a la:
$arguments = Array(
'term'=>'fargo',
'expand'=>'formats,synopsis',
'max_results'=> '1',
'output'=>'json'
);
  1. Netflix now has this open OData API in the works, too. So I might not even need to use the old API that requires a key …

That's to say that while I need to read more, if the ODdata API is also only for streaming titles then I can still retrieve the Netflix movie identifier from the OData API for given titles. What this means is that I should still be able to pass a list of Hammer film titles to the OData API and scrape the results for the movie's identifier. This in turn means I can create a link so I can start streaming the movie by clicking on a hyperlink.

Here's an OData example for "The Name of the Rose" taken from the Netflix developer site:

http://odata.netflix.com/Catalog/Titles?$filter=Name%20eq%20'The%20Name%20of%20The%20Rose'

Looking at the source for the results reveals the Netflix movie identifier like so:

<d:Url>http://www.netflix.com/Movie/The_Name_of_the_Rose/70000552</d:Url>

With that identifier, I should just be able to pass a link to the streaming page like this (must be logged into Netflix):

http://movies.netflix.com/WiPlayer?movieid=70000552

Ok, I just clicked on that and now there's a good possibility I'll be watching "The Name of the Rose" tonight … or not.

;(

--------------

Related Content:

Written by nitin

August 28th, 2011 at 8:20 pm

HammerFlix

leave a comment

Update, November 27, 2011: If you're looking for a live list of Hammer Films streaming on Netflix you can see it here.

To read more about the HammerFlicks project, click here.

It's been a while since I've posted … I'm prepping to leave Tuscaloosa, AL for a new job (more on that later), but I thought I should get myself, as this blog is primarily a reference point for me, up-to-date.

So let me get right to it.

I have Netflix.

I use their Watch Instantly feature often.

I use this feature to watch films made by the Hammer Film Productions company, often.

Hammer made a lot of great off-beat horror films and they just have a certain style that I love. The films I've seen of theirs feature, more-often-than-not , well-crafted and well-acted tales of strangeness with sympathetic characters and beautiful women – where story, and not spectacle, rules the day.

In fact, my first Hammer Film was Dr. Jeckyll and Sister Hyde. I won't give it away, but I highly recommend it. It has all the traits mentioned above that I associate with Hammer Films.

source: imdb.com

Anyway, Netflix, to my knowledge, doesn't allow me to search by production companies. But I want to know which Hammer Films are available on Netflix and if I can stream them. Unless and until Netflix ever allows this search, it seems I'll have to roll my own solution.

The idea is to use the IMDB data files to get a list of the film titles where Hammer was the production company. Then, using the Netflix API, I can get a report on those titles in the Netflix catalog.

This is a pretty simple idea, but one that I'd personally find very useful.

I've just started working on it and I'll share my work as soon as it's done. I'm not sure if I can offer this sort of searching as a service – there might be some legal issues – but I can at least share the methodology.

Now, if anyone out there knows of a way to already do this, please let me know.

--------------

Related Content:

Written by nitin

February 27th, 2011 at 10:09 am

Switch to our mobile site