Milton Keanes EscortsGirl With Oversized NipplesBig Boobed HosBras Panties ThongsBbw Mature OrgyStargate Dr Weir NakedCassandra Lynn Yellow BikiniHot Ebony Chick VideoStephen Lawrence Aged 10Natural Sexy Black NudesCurrent Midget ActorsMan Puts Head In Womans PussyMap Toad SuckMediserve Nursing AgencyEssential Fatty Acids And Atopic DermatitisIpswich Striper FishingEbony DommesModel Of Primary Health CareSoftcore Movies XxxIsland Hideaway Virgin IslandsWhy Mnscu SucksHammer Blow Corp TrailerSwimming Vaginal Itch PregnantThe Ikki Twins In PlayboyFemale Bodybuilder Porn ForumStrip HermioneStocking Fetish 2009 Jelsoft Enterprises LtdHiv Testing ForumJiffy Luibe BatteryArabian Amateur TgpBig Boob MaidUsaf Blue Suit UniformUbuntu Record Incoming WebcamGay Army FuckingShes Freaky Pitbull Mp3Big Boobed MexicansMisty Marie BondModel Dean TuckerThe Girls Next Door Playboy SpreadTiny Butt HoleSize Of A Bald EagleFree Uncut Cocks Huge AnalTeen SextopIncrediable AssFemale Genitourinary ExamTim Tivo GirlfriendAmy Adams Free Nude Picks38dd Female PicturesBreast Cancer Awareness Desktop WallpaperSapphic Erotica Hairy MoviesModel 50 Gerrard Record PlayerEnormus Cock AnalThe Mermaid Of Rainy Lake GpsAtlanta Excite Adult MagazineGrandmas Having Sex MoviesAirtel To Std Call Free TrickLovers StoriesUnder The Rainbow SexPersonal Pleasure With PillowGaleri LesbiennesCryotherapy Prostate CancerVintage Zippo Princeton UniversityAdult Novelty Shop IiMy Favorite Nude Boy PicsFunny Adult Cartoon GalleryBuffie The Body Sex TapeHentai Ass HoleSanaa Lathen Sex SceneOmega-3 Fatty Acid ContentElizabeth Berkeley Pussy PicsSexy Volleyball Shorts GalleriesMasterbation With Medical EquipmentAvs Hairless Young PussyBone Marrow Transplants For Hiv PatientClothespins SexCameron Diaz Nude PictureMrblacc SexyFeeding Barley To PoultryWhat Is Using My WebcamAmateur Facials ThumbnailsSomething Sexy Planet StoreKozy Collar Pluming Stack FlashingNursing School PopulationBlack Street NudityPlaylist For Adult DancesApril May AnalAdvanced Chat Rooms For TeensCalifornia Nurse AnesthesiaWhite Patches In ThroatNone Nude BoardEbony Godesses Squirting BukakkaeHades Wife PersephoneBaseball Loving PresidentMultiple Pole VibratorHillhaven Nursing HomeVintage Diamondback BikesCum Swallow ArchiveRussia Porn Big 02Petite Teens BjNew York Tivoli Pregnancy Portrait Photographer

Netflix API Authentication with the Ruby Oauth Gem

For any folks out there struggling to get the Ruby OAuth gem working with Netflix authentication, here’s a quick run down on how to get started.

The 0.2.7 version of Ruby OAuth isn’t totally compatible with the Netflix authentication APIs. However, thanks to the grooviness that it is GitHub, Rob Ares graciously forked the OAuth gem in order to get it working. So clone his repository and get cracking!

Here’s a start:


require "oauth/consumer"
consumer = OAuth::Consumer.new(
      "developer api key",
      "developer api secret",
      {
        :site => "http://api.netflix.com",
        :request_token_url => "https://api-user.netflix.com/oauth/request_token",
        :access_token_url => "http://api.netflix.com/oauth/access_token",
        :authorize_url => "https://api-user.netflix.com/oauth/login"
      })

    request_token = consumer.get_request_token  

 request_token.authorize_url({
      :o auth_consumer_key => "you developer api key",
      :application_name => "application name",
      :o auth_callback => "optional"
    })

    access_token = request_token.get_access_token

    response = consumer.request(
      :get,
      "/users/#{access_token.response[:user_id]}",
      access_token,
      {:scheme => :query_string})

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

One Response to “Netflix API Authentication with the Ruby Oauth Gem”

  1. Lee

    Thanks for this. It’s helpful.

    I’ve got a special problem that I’m stuck on. My users are not coming in via browser, so I can’t redirect them to get an access_token. I think I can get them to do this once during registration and then store their access_token for future use. According to Netflix, it doesn’t expire.

    So, I’m trying to figure out how to replace the calls to authorize_url (not needed) and get_access_token with something that I retrieve from my database, associated with the user.

    The trouble is that I can’t figure out how to use the library to make this work. I’ve tried replacing the get_access_token call with the internal constructor it contains for OAuth::AccessToken, but I’m doing something wrong, because my subsequent requests fail with either a 401 Unauthorized or undefined method `[]‘ for nil:NilClass.

    That second error seems to come from the missing access_token.response[:user_id]. But the OAuth::AccessToken constructor didn’t take that as a parameter, so I’m confused by how it gets populated.

    Can you enlighten me? (Sorry for this long comment. It’s not spam. :-)

Leave a Reply