New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kubrick

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kubrick

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Kubrick

A simple Ruby wrapper for the Netflix REST API


Kubrick is a Ruby wrapper for the Netflix REST API. It is nowhere near ready for use.

Usage

  1. Go to the Netflix API keys website and sign up for an account if you haven't done so yet. Register an application.

  2. Start the OAuth authentication process. Kubrick's OAuth setup is designed to be as simple as possible. Start by initializing the Authenticator class and passing in your consumer key and secret:

    authenticator = Kubrick::Authenticator.new("consumer key", "consumer secret")

Next, get a request token. Note that you must save this temporarily somehow as you will need it after you redirect your user to Netflix's login page.

request_token = authenticator.get_request_token

Pass the output of that method and your callback URL into login_url to get the URL you should redirect your user to:

redirect_url = authenticator.login_url(request_token, "callback_url")

When your user returns, pass your request token (the one you had to save earlier) into get_access_token.

access_token = authenticator.get_access_token(request_token)

MAKE SURE TO SAVE THE ACCESS TOKEN. It won't change unless the user revokes access to your application.

You can now make calls by passing in the access token details and your consumer details. Like this:

m = Kubrick::Movie.new(access_token, {:oauth_consumer_key => "consumer_key", :oauth_consumer_secret => "consumer_secret"})
m.find_by_title("2001: A Space Odyssey")

Warning!

Kubrick is by no means ready for use. It's not even close to complete. If you want to use it, go ahead, but be warned that the API's may change by surprise.

Do whatever the heck you want with this. Fork it, rewrite, sell it as your own. I don't care. But please retain credit to me and any contributors.

© Copyright 2012 J-P Teti.

FAQs

Package last updated on 20 Feb 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc