Twitter on Rails
Upcoming SlideShare
Loading in...5
×
 

Twitter on Rails

on

  • 13,258 views

Learn how to build a Twitter application on Rails. Fast. Presented at RailsConf 2009 by Michael Bleigh.

Learn how to build a Twitter application on Rails. Fast. Presented at RailsConf 2009 by Michael Bleigh.

Statistics

Views

Total Views
13,258
Views on SlideShare
12,838
Embed Views
420

Actions

Likes
10
Downloads
114
Comments
0

16 Embeds 420

http://www.intridea.com 138
http://intridea.com 109
http://www.slideshare.net 96
http://efboo.cn 48
http://staging.intridea.com 5
http://www.linkedin.com 4
http://www.railsfire.com 3
http://coderwall.com 3
http://blog.dasmith.co.uk 3
http://www.akamonitor.cz 3
http://webcache.googleusercontent.com 2
http://www.efboo.cn 2
http://tumble.dasmith.co.uk 1
http://localhost 1
http://pulpitum.intridea.com 1
http://translate.googleusercontent.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Twitter on Rails Twitter on Rails Presentation Transcript

  • Twitter on Rails Michael Bleigh, RailsConf 2009 Wednesday, May 6, 2009
  • Wednesday, May 6, 2009
  • Wednesday, May 6, 2009
  • What’s the big f-ing deal? Wednesday, May 6, 2009
  • MySpace Wednesday, May 6, 2009
  • MySpace Wednesday, May 6, 2009
  • Facebook Wednesday, May 6, 2009
  • Facebook Wednesday, May 6, 2009
  • How is different? Wednesday, May 6, 2009
  • Audience. Ben Garney via Flickr Wednesday, May 6, 2009
  • Public. three-B via Flickr Wednesday, May 6, 2009
  • Search. Vitó via Flickr Wednesday, May 6, 2009
  • API. benben via Flickr Wednesday, May 6, 2009
  • In Code Wednesday, May 6, 2009
  • Search API Wednesday, May 6, 2009
  • require 'open-uri' require 'json' def search_twitter_for(query) query = CGI.escape(query) JSON.parse( open(quot;http://search.twitter.com/search.json?q=#{query}quot;).read )['results'] end search_twitter_for('RailsConf').collect{|s| s['text']} [ quot;Packing up for #railsconf. Swine flu here we come!quot;, quot;Putting new strings on some guitars for the #RailsConf music jam”, quot;Vegas, baby! All the @contrast boys laying into their first drinks...”, ... ] Wednesday, May 6, 2009
  • OAuth Wednesday, May 6, 2009
  • TCM Hitchhiker via Flickr Wednesday, May 6, 2009
  • There’s a gem for that. ArtWerk via Flickr Wednesday, May 6, 2009
  • The OAuth Shuffle • Consumer • Request Token • Authorization • Access! Wednesday, May 6, 2009
  • Sign in with Twitter • Consumer • Request Token • Authorize (Just Once) • Access! Wednesday, May 6, 2009
  • 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
  • Caveat OAuth • The Advisory (no callbacks) • Solution: One Dev App • Read/Write Inconsistency • Solution: Delete and Recreate Wednesday, May 6, 2009
  • Rails Wednesday, May 6, 2009
  • TwitterAuth github.com/mbleigh/twitter-auth Wednesday, May 6, 2009
  • TwitterAuth makes Rails Twitter apps stupid simple. Wednesday, May 6, 2009
  • Just enough magic. Steffe via Flickr Wednesday, May 6, 2009
  • Livecoding! Wednesday, May 6, 2009
  • Twisteners Who actually listens? Wednesday, May 6, 2009
  • Application Goals • Log in via Twitter • See a list of top mentioners • Tweet the top three “twisteners” Wednesday, May 6, 2009
  • Step 1: Credentials Wednesday, May 6, 2009
  • twitter.com/apps Wednesday, May 6, 2009
  • Step 2: Template Wednesday, May 6, 2009
  • Type the Magic Words rails -m http://bit.ly/twitter-rails yourapp Wednesday, May 6, 2009
  • TwitterAuth • Engines-based login • logged_in? and current_user • user.twitter.get(‘/api/path’) Wednesday, May 6, 2009
  • Twitter Template • helpers for common twitter needs • instant gratification Wednesday, May 6, 2009
  • Step 3: Aggregate Wednesday, May 6, 2009
  • Step 4: Share Wednesday, May 6, 2009
  • twisteners.heroku.com github.com/mbleigh/twisteners Wednesday, May 6, 2009
  • Follow me: @mbleigh Wednesday, May 6, 2009