开发者

Determine recently queued/number of queues for titles, recently watched, etc via Netflix API

开发者 https://www.devze.com 2023-02-22 01:29 出处:网络
I\'ve seen other websites (InstantWatcher & Instant Watch DB) doing this, but how? I don\'t see anything in the API that exposes this kind of data? This is driving me batty! How are they doing it?

I've seen other websites (InstantWatcher & Instant Watch DB) doing this, but how? I don't see anything in the API that exposes this kind of data? This is driving me batty! How are they doing it?! Am I missing something in the API??

And there is nothing in Go开发者_运维知识库ogle-land regarding this. I've looked...


You need to start tracking this data on your own. You can put a JavaScript hook on the "play" or "queue" buttons/links that pings you server and increments the queue/play count for the title in your datastore.

If you look at the add queue button on instantwatchdb.com, you'll see this kind of hook:

<a href="#" class="modal" 
onclick="javascript:nflx.addToQueue(
'http://api.netflix.com/catalog/titles/movies/60024224', 
-230, -15, '8zgw3pprk2n5byjfuv3f52y4', 'instant', 'title_links'); 
logQueue('166252'); return false; return false;">Add to Instant Queue</a>

The logQueue call is to an custom JavaScript that increments the local queue count.

function logQueue(movieId)
{
  new Ajax.Request('/ajax/activity/queue', {
    method: 'post',
    parameters: {
      movie: movieId
    }
  });
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号