TM




Saturday, July 24, 2010
@twitterapi
                          #appworkshop @themattharris @heroku




 @heroku                                    ...
About us


                                     TM




Saturday, July 24, 2010
The   team




                                  TM




Saturday, July 24, 2010
@themattharris
                          About me




                                           TM




Saturday, July 24,...
What is                ?
                          The Twitter Platform




                                              ...
What is                ?
                     ‣    REST API
                     ‣    provides the “basic” Twitter functio...
Limits
                     ‣    350 API calls/hour using OAuth against api.twitter.com
                     ‣    Unauthen...
dev.twitter.com
                          The developer portal




                                                 TM



...
Creating an app
                          Your own small playground




                                                  ...
TM




Saturday, July 24, 2010
TM




Saturday, July 24, 2010
TM




Saturday, July 24, 2010
Browsing docs


                                          TM




Saturday, July 24, 2010
TM




Saturday, July 24, 2010
TM




Saturday, July 24, 2010
TM




Saturday, July 24, 2010
OAuthpocalypse
                          The day is 30th June 16th August 2010




                                       ...
What you need to know
                     ‣    All applications must be using OAuth for the REST API
                    ...
OAuth Methods
                     ‣    Web must use three legged OAuth
                     ‣    Desktop and mobile apps ...
xAuth not XAuth



                            xAuth is OAuth

                               http://dev.twitter.com/pages...
Check your host!



                             api.twitter.com

                                twitter.com
            ...
Libraries
                     ActionScript/Flash          Objective-C/Cocoa & iPhone Programming
                     C/C...
twurl
                     ‣    http://github.com/marcel/twurl
                     ‣    Command line tool to interact    ...
Timelines


                                      TM




Saturday, July 24, 2010
Timeline Endpoints
                     ‣    /1/statuses/public_timeline
                     ‣    /1/statuses/home_timeli...
Modifiers
                     ‣    include_rts




                    Accepted values: true, 1, t

                     ...
Modifiers
                     ‣    include_rts
                     ‣    include_entities




                    Accepte...
Modifiers
                     ‣    include_rts
                     ‣    include_entities
                     ‣    trim_...
Geo


                                TM




Saturday, July 24, 2010
Endpoints
                     ‣    /1/geo/search
                     ‣    /1/geo/similar_places
                     ‣  ...
Create a place
                     ‣    /1/geo/search
                          ‣   show what’s nearby
                  ...
Get location (if allowed)




                                                 TM




Saturday, July 24, 2010
Get location (if allowed)




                                                 TM




Saturday, July 24, 2010
/1/geo/search - suggest nearby




                                                      TM




Saturday, July 24, 2010
/1/geo/search - suggest nearby




                                                      TM




Saturday, July 24, 2010
/1/geo/similar_places - find by name




                                                            TM




Saturday, July...
/1/geo/similar_places - find by name




                                                            TM




Saturday, July...
/1/geo/place - not it? create it




                                                        TM




Saturday, July 24, 2010
Technical Info ...
                     ‣    /1/geo/similar_places
                          ‣   must run this first to ge...
Technical Info ...
               	
  	
  	
  	
  	
  	
  	
  	
  ],
               	
  	
  	
  	
  	
  	
  	
  	
  "full_...
More Info...   Check out
                                         bit.ly/twitter-api-geo




                             ...
@anywhere


                                      TM




Saturday, July 24, 2010
Core Features
                     ‣    Hovercards
                     ‣    Tweet Box
                     ‣    Follow Bu...
Easiest Example
            <head>
               <script
           src="http://platform.twitter.com/anywhere.js?id=YOUR_...
Easiest Example
            <head>
               <script
           src="http://platform.twitter.com/anywhere.js?id=YOUR_...
Easiest Example
            <head>
               <script
           src="http://platform.twitter.com/anywhere.js?id=YOUR_...
Easiest Example
            <head>
               <script
           src="http://platform.twitter.com/anywhere.js?id=YOUR_...
Easiest Example
            <head>
               <script
           src="http://platform.twitter.com/anywhere.js?id=YOUR_...
More Info...   Check out
                                         bit.ly/anywhere-begin




                              ...
Bridge Code
                          @anywhere to api.twitter.com




                                                   ...
Overview

                     ‣    Use connect with Twitter
                     ‣    Hook into authComplete
            ...
Use connect with Twitter
                  T("#connect-placeholder").connectButton({
                    authComplete: fun...
Hook into authComplete
                  T("#connect-placeholder").connectButton({
                    authComplete: funct...
Hook into authComplete
                  T("#connect-placeholder").connectButton({
                    authComplete: funct...
Send to your server
                  T("#connect-placeholder").connectButton({
                    authComplete: function...
Exchange the bridge code

                     ‣    POST to https://api.twitter.com/oauth/access_token
                   ...
Exchange the token - PHP
                  $http->request(
                     'POST',
                     'https://api....
Verify

                     ‣    Using the user tokens call
                          /1/account/verify_credentials.json
...
Streaming API
                          Near-Realtime Access to Public Statuses




                                      ...
Streaming API
                     ‣    A persistent connection to Twitter servers
                     ‣    Get pushed a ...
Basic Usage
                     ‣    Curl with Basic Auth or Twurl with OAuth
                     ‣    One connection pe...
Follow some users
                     ‣    Curl with Basic Auth or Twurl with OAuth
                     ‣    One connect...
Filter by keyword
                     ‣    Curl with Basic Auth or Twurl with OAuth
                     ‣    One connect...
Streaming API - Default Level
                     ‣    200 x Keywords
                     ‣    400 x Follow userids
    ...
More Info...   Check out
                                         bit.ly/streaming_api




                               ...
Stay Informed...   Join
                                             bit.ly/twitter-anywhere-talk
                        ...
Help...   Check out
                                    dev.twitter.com




                                              ...
Questions?   Follow us at
                                       twitter.com/twitterapi
                                  ...
TM




Saturday, July 24, 2010
Upcoming SlideShare
Loading in...5
×

@twitterapi at SocialApp Workshop

5,659

Published on

Presented 24 July 2010 at the Heroku Offices, San Francisco

Published in: Technology
0 Comments
5 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,659
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
45
Comments
0
Likes
5
Embeds 0
No embeds

No notes for slide

@twitterapi at SocialApp Workshop

  1. 1. TM Saturday, July 24, 2010
  2. 2. @twitterapi #appworkshop @themattharris @heroku @heroku TM July 24, 2010 Saturday, July 24, 2010
  3. 3. About us TM Saturday, July 24, 2010
  4. 4. The team TM Saturday, July 24, 2010
  5. 5. @themattharris About me TM Saturday, July 24, 2010
  6. 6. What is ? The Twitter Platform TM Saturday, July 24, 2010
  7. 7. What is ? ‣ REST API ‣ provides the “basic” Twitter functionality - tweet, follow, etc. ‣ all functions available on your timeline on twitter.com ‣ Search API ‣ real-time search index ‣ get “top tweets” / relevant search results ‣ Streaming API ‣ HTTP long-poll connection ‣ tweets come out of the system in real-time TM Saturday, July 24, 2010
  8. 8. Limits ‣ 350 API calls/hour using OAuth against api.twitter.com ‣ Unauthenticated it goes against the source IP address ‣ Authenticated it goes against the calling user ‣ “Natural” limits on ‣ number of tweets sent ‣ number of DMs sent ‣ number of followings / unfollowings ‣ Status limits ‣ No duplicate tweets ‣ No malware links in tweets TM Saturday, July 24, 2010
  9. 9. dev.twitter.com The developer portal TM Saturday, July 24, 2010
  10. 10. Creating an app Your own small playground TM Saturday, July 24, 2010
  11. 11. TM Saturday, July 24, 2010
  12. 12. TM Saturday, July 24, 2010
  13. 13. TM Saturday, July 24, 2010
  14. 14. Browsing docs TM Saturday, July 24, 2010
  15. 15. TM Saturday, July 24, 2010
  16. 16. TM Saturday, July 24, 2010
  17. 17. TM Saturday, July 24, 2010
  18. 18. OAuthpocalypse The day is 30th June 16th August 2010 TM Saturday, July 24, 2010
  19. 19. What you need to know ‣ All applications must be using OAuth for the REST API ‣ Streaming API will still support Basic Auth ‣ Search API has no auth ‣ Replace curl with twurl for debugging http://dev.twitter.com/pages/auth_overview http://github.com/marcel/twurl TM Saturday, July 24, 2010
  20. 20. OAuth Methods ‣ Web must use three legged OAuth ‣ Desktop and mobile apps can also use out-of-band OAuth ‣ Some desktop and mobile apps will be considered for xAuth TM Saturday, July 24, 2010
  21. 21. xAuth not XAuth xAuth is OAuth http://dev.twitter.com/pages/xauth TM Saturday, July 24, 2010
  22. 22. Check your host! api.twitter.com twitter.com TM Saturday, July 24, 2010
  23. 23. Libraries ActionScript/Flash Objective-C/Cocoa & iPhone Programming C/C++ Perl C#/.NET PHP Clojure Python Erlang Qt Java Ruby JavaScript Scala http://dev.twitter.com/pages/oauth_libraries TM Saturday, July 24, 2010
  24. 24. twurl ‣ http://github.com/marcel/twurl ‣ Command line tool to interact with using OAuth ‣ Transparently handles OAuth signing against ‣ POST and GET data ‣ Trace requests TM Saturday, July 24, 2010
  25. 25. Timelines TM Saturday, July 24, 2010
  26. 26. Timeline Endpoints ‣ /1/statuses/public_timeline ‣ /1/statuses/home_timeline ‣ /1/statuses/friends_timeline ‣ /1/statuses/user_timeline ‣ /1/statuses/mentions ‣ /1/statuses/retweeted_by_me ‣ /1/statuses/retweeted_to_me ‣ /1/statuses/retweets_of_me TM Saturday, July 24, 2010
  27. 27. Modifiers ‣ include_rts Accepted values: true, 1, t TM Saturday, July 24, 2010
  28. 28. Modifiers ‣ include_rts ‣ include_entities Accepted values: true, 1, t TM Saturday, July 24, 2010
  29. 29. Modifiers ‣ include_rts ‣ include_entities ‣ trim_user Accepted values: true, 1, t TM Saturday, July 24, 2010
  30. 30. Geo TM Saturday, July 24, 2010
  31. 31. Endpoints ‣ /1/geo/search ‣ /1/geo/similar_places ‣ /1/geo/reverse_geocode ‣ /1/geo/id/:id ‣ /1/geo/place TM Saturday, July 24, 2010
  32. 32. Create a place ‣ /1/geo/search ‣ show what’s nearby ‣ /1/geo/similar_places ‣ not found in search, find by name ‣ /1/geo/place ‣ still not found, create a new place http://api.twitter.com/1/geo/place TM Saturday, July 24, 2010
  33. 33. Get location (if allowed) TM Saturday, July 24, 2010
  34. 34. Get location (if allowed) TM Saturday, July 24, 2010
  35. 35. /1/geo/search - suggest nearby TM Saturday, July 24, 2010
  36. 36. /1/geo/search - suggest nearby TM Saturday, July 24, 2010
  37. 37. /1/geo/similar_places - find by name TM Saturday, July 24, 2010
  38. 38. /1/geo/similar_places - find by name TM Saturday, July 24, 2010
  39. 39. /1/geo/place - not it? create it TM Saturday, July 24, 2010
  40. 40. Technical Info ... ‣ /1/geo/similar_places ‣ must run this first to get a creation_token TM Saturday, July 24, 2010
  41. 41. Technical Info ...                ],                "full_name":  "Twitter  HQ,  San  Francisco",                "place_type":  "poi"            }        ],        "token":  "36179c9bf78835898ebf521c1defd4be"    },    "query":  {        "url":  "http://api.twitter.com/1/geo/similar_places.json? query=&contained_within=&lat=37.7821120598956&accuracy=&autocompl ete=&long=-­‐122.400612831116&granularity=&name=Twitter",        "type":  "similar_places", TM Saturday, July 24, 2010
  42. 42. More Info... Check out bit.ly/twitter-api-geo TM Saturday, July 24, 2010
  43. 43. @anywhere TM Saturday, July 24, 2010
  44. 44. Core Features ‣ Hovercards ‣ Tweet Box ‣ Follow Buttons ‣ Linkify ‣ Connect with Twitter TM Saturday, July 24, 2010
  45. 45. Easiest Example <head> <script src="http://platform.twitter.com/anywhere.js?id=YOUR_API_KEY&amp;v=1"> </script> <script type="text/javascript"> twttr.anywhere(function(T) { T.hovercards(); T("#follow-placeholder").followButton('themattharris'); T("#tbox").tweetBox(); }); </script> </head> TM Saturday, July 24, 2010
  46. 46. Easiest Example <head> <script src="http://platform.twitter.com/anywhere.js?id=YOUR_API_KEY&amp;v=1"> </script> <script type="text/javascript"> twttr.anywhere(function(T) { T.hovercards(); T("#follow-placeholder").followButton('themattharris'); T("#tbox").tweetBox(); }); </script> </head> TM Saturday, July 24, 2010
  47. 47. Easiest Example <head> <script src="http://platform.twitter.com/anywhere.js?id=YOUR_API_KEY&amp;v=1"> </script> <script type="text/javascript"> twttr.anywhere(function(T) { T.hovercards(); T("#follow-placeholder").followButton('themattharris'); T("#tbox").tweetBox(); }); </script> </head> TM Saturday, July 24, 2010
  48. 48. Easiest Example <head> <script src="http://platform.twitter.com/anywhere.js?id=YOUR_API_KEY&amp;v=1"> </script> <script type="text/javascript"> twttr.anywhere(function(T) { T.hovercards(); T("#follow-placeholder").followButton('themattharris'); T("#tbox").tweetBox(); }); </script> </head> TM Saturday, July 24, 2010
  49. 49. Easiest Example <head> <script src="http://platform.twitter.com/anywhere.js?id=YOUR_API_KEY&amp;v=1"> </script> <script type="text/javascript"> twttr.anywhere(function(T) { T.hovercards(); T("#follow-placeholder").followButton('themattharris'); T("#tbox").tweetBox(); }); </script> </head> TM Saturday, July 24, 2010
  50. 50. More Info... Check out bit.ly/anywhere-begin TM Saturday, July 24, 2010
  51. 51. Bridge Code @anywhere to api.twitter.com TM Saturday, July 24, 2010
  52. 52. Overview ‣ Use connect with Twitter ‣ Hook into authComplete ‣ Send the bridge code to your server ‣ Exchange the bridge code using /oauth/access_token ‣ Verify TM Saturday, July 24, 2010
  53. 53. Use connect with Twitter T("#connect-placeholder").connectButton({ authComplete: function(user, bridge_code) { $.post('/mypage.php', { 'bridge_code' : bridge_code }); } }); TM Saturday, July 24, 2010
  54. 54. Hook into authComplete T("#connect-placeholder").connectButton({ authComplete: function(user, bridge_code) { $.post('/mypage.php', { 'bridge_code' : bridge_code }); } }); TM Saturday, July 24, 2010
  55. 55. Hook into authComplete T("#connect-placeholder").connectButton({ authComplete: function(user, bridge_code) { $.post('/mypage.php', { 'bridge_code' : bridge_code }); } }); TM Saturday, July 24, 2010
  56. 56. Send to your server T("#connect-placeholder").connectButton({ authComplete: function(user, bridge_code) { $.post('/mypage.php', { 'bridge_code' : bridge_code }); } }); TM Saturday, July 24, 2010
  57. 57. Exchange the bridge code ‣ POST to https://api.twitter.com/oauth/access_token ‣ Parameter is oauth_bridge_code ‣ Sign with your applications consumer token and secret TM Saturday, July 24, 2010
  58. 58. Exchange the token - PHP $http->request( 'POST', 'https://api.twitter.com/oauth/access_token', array( 'oauth_bridge_code' => $_REQUEST['bridge_code'] ) ); TM Saturday, July 24, 2010
  59. 59. Verify ‣ Using the user tokens call /1/account/verify_credentials.json ‣ Generate the signature sha1( user_id + consumer_secret ) ‣ Compare the signature with the cookie value in twitter_anywhere_identity TM Saturday, July 24, 2010
  60. 60. Streaming API Near-Realtime Access to Public Statuses TM Saturday, July 24, 2010
  61. 61. Streaming API ‣ A persistent connection to Twitter servers ‣ Get pushed a tweet that matches your predicate in “real-time” ‣ Server to server integrations TM Saturday, July 24, 2010
  62. 62. Basic Usage ‣ Curl with Basic Auth or Twurl with OAuth ‣ One connection per username permitted http://stream.twitter.com/1/statuses/sample.json TM Saturday, July 24, 2010
  63. 63. Follow some users ‣ Curl with Basic Auth or Twurl with OAuth ‣ One connection per username permitted ‣ Pass up to 400 user_ids, comma seperated http://stream.twitter.com/1/statuses/filter.json TM Saturday, July 24, 2010
  64. 64. Filter by keyword ‣ Curl with Basic Auth or Twurl with OAuth ‣ One connection per username permitted ‣ Pass up to 200 keywords, comma seperated ‣ Example: Twitter will return statuses which contain: TWITTER, twitter, "Twitter", twitter., #twitter and @twitter http://stream.twitter.com/1/statuses/filter.json TM Saturday, July 24, 2010
  65. 65. Streaming API - Default Level ‣ 200 x Keywords ‣ 400 x Follow userids ‣ 10 x 1-degree location boxes TM Saturday, July 24, 2010
  66. 66. More Info... Check out bit.ly/streaming_api TM Saturday, July 24, 2010
  67. 67. Stay Informed... Join bit.ly/twitter-anywhere-talk bit.ly/twitter-dev-talk Important Stuff @twitterapi status.twitter.com bit.ly/twitter-api-announce TM Saturday, July 24, 2010
  68. 68. Help... Check out dev.twitter.com TM Saturday, July 24, 2010
  69. 69. Questions? Follow us at twitter.com/twitterapi twitter.com/themattharris TM Saturday, July 24, 2010
  70. 70. TM Saturday, July 24, 2010
  1. ¿Le ha llamado la atención una diapositiva en particular?

    Recortar diapositivas es una manera útil de recopilar información importante para consultarla más tarde.

×