Twitter on Rails

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    7 Favorites

    Twitter on Rails - Presentation Transcript

    1. Twitter on Rails Michael Bleigh, RailsConf 2009 Wednesday, May 6, 2009
    2. Wednesday, May 6, 2009
    3. Wednesday, May 6, 2009
    4. What’s the big f-ing deal? Wednesday, May 6, 2009
    5. MySpace Wednesday, May 6, 2009
    6. MySpace Wednesday, May 6, 2009
    7. Facebook Wednesday, May 6, 2009
    8. Facebook Wednesday, May 6, 2009
    9. How is different? Wednesday, May 6, 2009
    10. Audience. Ben Garney via Flickr Wednesday, May 6, 2009
    11. Public. three-B via Flickr Wednesday, May 6, 2009
    12. Search. Vitó via Flickr Wednesday, May 6, 2009
    13. API. benben via Flickr Wednesday, May 6, 2009
    14. In Code Wednesday, May 6, 2009
    15. Search API Wednesday, May 6, 2009
    16. require 'open-uri' require 'json' def search_twitter_for(query) query = CGI.escape(query) JSON.parse( open(\"http://search.twitter.com/search.json?q=#{query}\").read )['results'] end search_twitter_for('RailsConf').collect{|s| s['text']} [ \"Packing up for #railsconf. Swine flu here we come!\", \"Putting new strings on some guitars for the #RailsConf music jam”, \"Vegas, baby! All the @contrast boys laying into their first drinks...”, ... ] Wednesday, May 6, 2009
    17. OAuth Wednesday, May 6, 2009
    18. TCM Hitchhiker via Flickr Wednesday, May 6, 2009
    19. There’s a gem for that. ArtWerk via Flickr Wednesday, May 6, 2009
    20. The OAuth Shuffle • Consumer • Request Token • Authorization • Access! Wednesday, May 6, 2009
    21. Sign in with Twitter • Consumer • Request Token • Authorize (Just Once) • Access! Wednesday, May 6, 2009
    22. gem install oauth --version 0.3.2 require 'oauth' require 'json' # register your application at http://twitter.com/apps consumer = OAuth::Consumer.new( 'mykey','mysecret', :site => 'http://twitter.com/' ) request_token = consumer.get_request_token puts request_token.authorize_url # go and visit the authorize URL access_token = request_token.get_access_token me = JSON.parse(access_token.get('/account/verify_credentials.json').body) me['screen_name'] # => 'mbleigh' Wednesday, May 6, 2009
    23. Caveat OAuth • The Advisory (no callbacks) • Solution: One Dev App • Read/Write Inconsistency • Solution: Delete and Recreate Wednesday, May 6, 2009
    24. Rails Wednesday, May 6, 2009
    25. TwitterAuth github.com/mbleigh/twitter-auth Wednesday, May 6, 2009
    26. TwitterAuth makes Rails Twitter apps stupid simple. Wednesday, May 6, 2009
    27. Just enough magic. Steffe via Flickr Wednesday, May 6, 2009
    28. Livecoding! Wednesday, May 6, 2009
    29. Twisteners Who actually listens? Wednesday, May 6, 2009
    30. Application Goals • Log in via Twitter • See a list of top mentioners • Tweet the top three “twisteners” Wednesday, May 6, 2009
    31. Step 1: Credentials Wednesday, May 6, 2009
    32. twitter.com/apps Wednesday, May 6, 2009
    33. Step 2: Template Wednesday, May 6, 2009
    34. Type the Magic Words rails -m http://bit.ly/twitter-rails yourapp Wednesday, May 6, 2009
    35. TwitterAuth • Engines-based login • logged_in? and current_user • user.twitter.get(‘/api/path’) Wednesday, May 6, 2009
    36. Twitter Template • helpers for common twitter needs • instant gratification Wednesday, May 6, 2009
    37. Step 3: Aggregate Wednesday, May 6, 2009
    38. Step 4: Share Wednesday, May 6, 2009
    39. twisteners.heroku.com github.com/mbleigh/twisteners Wednesday, May 6, 2009
    40. Follow me: @mbleigh Wednesday, May 6, 2009

    + mbleighmbleigh, 6 months ago

    custom

    2576 views, 7 favs, 3 embeds more stats

    Learn how to build a Twitter application on Rails. more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 2576
      • 2402 on SlideShare
      • 174 from embeds
    • Comments 0
    • Favorites 7
    • Downloads 39
    Most viewed embeds
    • 123 views on http://www.intridea.com
    • 48 views on http://intridea.com
    • 3 views on http://www.railsfire.com

    more

    All embeds
    • 123 views on http://www.intridea.com
    • 48 views on http://intridea.com
    • 3 views on http://www.railsfire.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories