SlideShare a Scribd company logo
1 of 70
Download to read offline
TM




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




 @heroku                                                        TM



 July 24, 2010
Saturday, July 24, 2010
About us


                                     TM




Saturday, July 24, 2010
The   team




                                  TM




Saturday, July 24, 2010
@themattharris
                          About me




                                           TM




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




                                                     TM




Saturday, July 24, 2010
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
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
dev.twitter.com
                          The developer portal




                                                 TM




Saturday, July 24, 2010
Creating an app
                          Your own small playground




                                                      TM




Saturday, July 24, 2010
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




                                                                  TM




Saturday, July 24, 2010
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
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
xAuth not XAuth



                            xAuth is OAuth

                               http://dev.twitter.com/pages/xauth

                                                                    TM




Saturday, July 24, 2010
Check your host!



                             api.twitter.com

                                twitter.com
                                               TM




Saturday, July 24, 2010
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
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
Timelines


                                      TM




Saturday, July 24, 2010
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
Modifiers
                     ‣    include_rts




                    Accepted values: true, 1, t

                                                  TM




Saturday, July 24, 2010
Modifiers
                     ‣    include_rts
                     ‣    include_entities




                    Accepted values: true, 1, t

                                                  TM




Saturday, July 24, 2010
Modifiers
                     ‣    include_rts
                     ‣    include_entities
                     ‣    trim_user




                    Accepted values: true, 1, t

                                                  TM




Saturday, July 24, 2010
Geo


                                TM




Saturday, July 24, 2010
Endpoints
                     ‣    /1/geo/search
                     ‣    /1/geo/similar_places
                     ‣    /1/geo/reverse_geocode
                     ‣    /1/geo/id/:id
                     ‣    /1/geo/place




                                                   TM




Saturday, July 24, 2010
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
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 24, 2010
/1/geo/similar_places - find by name




                                                            TM




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




                                                        TM




Saturday, July 24, 2010
Technical Info ...
                     ‣    /1/geo/similar_places
                          ‣   must run this first to get a creation_token




                                                                            TM




Saturday, July 24, 2010
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
More Info...   Check out
                                         bit.ly/twitter-api-geo




                                                                  TM




Saturday, July 24, 2010
@anywhere


                                      TM




Saturday, July 24, 2010
Core Features
                     ‣    Hovercards
                     ‣    Tweet Box
                     ‣    Follow Buttons
                     ‣    Linkify
                     ‣    Connect with Twitter




                                                 TM




Saturday, July 24, 2010
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
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
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
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
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
More Info...   Check out
                                         bit.ly/anywhere-begin




                                                                 TM




Saturday, July 24, 2010
Bridge Code
                          @anywhere to api.twitter.com




                                                         TM




Saturday, July 24, 2010
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
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
Hook into authComplete
                  T("#connect-placeholder").connectButton({
                    authComplete: function(user, bridge_code) {
                      $.post('/mypage.php', {
                        'bridge_code' : bridge_code
                      });
                    }
                  });




                                                                  TM




Saturday, July 24, 2010
Hook into authComplete
                  T("#connect-placeholder").connectButton({
                    authComplete: function(user, bridge_code) {
                      $.post('/mypage.php', {
                        'bridge_code' : bridge_code
                      });
                    }
                  });




                                                                  TM




Saturday, July 24, 2010
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
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
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
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
Streaming API
                          Near-Realtime Access to Public Statuses




                                                                    TM




Saturday, July 24, 2010
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
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
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
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
Streaming API - Default Level
                     ‣    200 x Keywords
                     ‣    400 x Follow userids
                     ‣    10 x 1-degree location boxes




                                                         TM




Saturday, July 24, 2010
More Info...   Check out
                                         bit.ly/streaming_api




                                                                TM




Saturday, July 24, 2010
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
Help...   Check out
                                    dev.twitter.com




                                                      TM




Saturday, July 24, 2010
Questions?   Follow us at
                                       twitter.com/twitterapi
                                       twitter.com/themattharris




                                                              TM




Saturday, July 24, 2010
TM




Saturday, July 24, 2010

More Related Content

Viewers also liked

Novedades literatura enero. Biblioteca Provincial da Coruña
Novedades literatura enero. Biblioteca Provincial da CoruñaNovedades literatura enero. Biblioteca Provincial da Coruña
Novedades literatura enero. Biblioteca Provincial da CoruñaBibliotecadicoruna
 
Fibra optica
Fibra opticaFibra optica
Fibra opticacaramelo5
 
La consulta astrológica claudia rizzi
La consulta astrológica   claudia rizziLa consulta astrológica   claudia rizzi
La consulta astrológica claudia rizziNati Bogado
 
Natalia gomez comunicacion masiva
Natalia gomez comunicacion masivaNatalia gomez comunicacion masiva
Natalia gomez comunicacion masivanatalia gomez
 
HTML email best practices
HTML email best practicesHTML email best practices
HTML email best practicesJeffrey Barke
 
El tió
El tióEl tió
El tiónfont
 
ICF session "Coaching the Distance: Increase Your Impact with Technology and ...
ICF session "Coaching the Distance: Increase Your Impact with Technology and ...ICF session "Coaching the Distance: Increase Your Impact with Technology and ...
ICF session "Coaching the Distance: Increase Your Impact with Technology and ...Ralf Wolter
 
Amitech industrial Cooling
Amitech industrial CoolingAmitech industrial Cooling
Amitech industrial Coolinglcs13262
 
Generali Group 2015 First Half Results
Generali Group 2015 First Half ResultsGenerali Group 2015 First Half Results
Generali Group 2015 First Half ResultsGenerali
 
Institución educativa ciudadela del sur 3 periodo
Institución educativa ciudadela del sur 3 periodoInstitución educativa ciudadela del sur 3 periodo
Institución educativa ciudadela del sur 3 periodoJovanni Patiño
 
Las 7 maravillas del mundo
Las 7 maravillas del mundoLas 7 maravillas del mundo
Las 7 maravillas del mundoyisbell21
 
Using Email, File, Social Media and Mobile Archiving to Grow Your Business
Using Email, File, Social Media and Mobile Archiving to Grow Your BusinessUsing Email, File, Social Media and Mobile Archiving to Grow Your Business
Using Email, File, Social Media and Mobile Archiving to Grow Your BusinessOsterman Research, Inc.
 
Conclusiones Jornada Telspain sobre Tendencias en Formación Virtual:
Conclusiones Jornada Telspain sobre Tendencias en Formación Virtual: Conclusiones Jornada Telspain sobre Tendencias en Formación Virtual:
Conclusiones Jornada Telspain sobre Tendencias en Formación Virtual: Telspain
 

Viewers also liked (18)

Compilar programa c++ en vs .net
Compilar programa c++ en vs .netCompilar programa c++ en vs .net
Compilar programa c++ en vs .net
 
Novedades literatura enero. Biblioteca Provincial da Coruña
Novedades literatura enero. Biblioteca Provincial da CoruñaNovedades literatura enero. Biblioteca Provincial da Coruña
Novedades literatura enero. Biblioteca Provincial da Coruña
 
Fibra optica
Fibra opticaFibra optica
Fibra optica
 
La consulta astrológica claudia rizzi
La consulta astrológica   claudia rizziLa consulta astrológica   claudia rizzi
La consulta astrológica claudia rizzi
 
Natalia gomez comunicacion masiva
Natalia gomez comunicacion masivaNatalia gomez comunicacion masiva
Natalia gomez comunicacion masiva
 
Presentación del informe eCanarias 2012
Presentación del informe eCanarias 2012Presentación del informe eCanarias 2012
Presentación del informe eCanarias 2012
 
HTML email best practices
HTML email best practicesHTML email best practices
HTML email best practices
 
Andorra2 Escaldes
Andorra2 EscaldesAndorra2 Escaldes
Andorra2 Escaldes
 
El tió
El tióEl tió
El tió
 
ICF session "Coaching the Distance: Increase Your Impact with Technology and ...
ICF session "Coaching the Distance: Increase Your Impact with Technology and ...ICF session "Coaching the Distance: Increase Your Impact with Technology and ...
ICF session "Coaching the Distance: Increase Your Impact with Technology and ...
 
Amitech industrial Cooling
Amitech industrial CoolingAmitech industrial Cooling
Amitech industrial Cooling
 
Generali Group 2015 First Half Results
Generali Group 2015 First Half ResultsGenerali Group 2015 First Half Results
Generali Group 2015 First Half Results
 
Institución educativa ciudadela del sur 3 periodo
Institución educativa ciudadela del sur 3 periodoInstitución educativa ciudadela del sur 3 periodo
Institución educativa ciudadela del sur 3 periodo
 
Las 7 maravillas del mundo
Las 7 maravillas del mundoLas 7 maravillas del mundo
Las 7 maravillas del mundo
 
Using Email, File, Social Media and Mobile Archiving to Grow Your Business
Using Email, File, Social Media and Mobile Archiving to Grow Your BusinessUsing Email, File, Social Media and Mobile Archiving to Grow Your Business
Using Email, File, Social Media and Mobile Archiving to Grow Your Business
 
2015_SUMMER_RMC_MSR.PDF
2015_SUMMER_RMC_MSR.PDF2015_SUMMER_RMC_MSR.PDF
2015_SUMMER_RMC_MSR.PDF
 
Bajo el cielo de san cristóbal de las casas
Bajo el cielo de san cristóbal de las casasBajo el cielo de san cristóbal de las casas
Bajo el cielo de san cristóbal de las casas
 
Conclusiones Jornada Telspain sobre Tendencias en Formación Virtual:
Conclusiones Jornada Telspain sobre Tendencias en Formación Virtual: Conclusiones Jornada Telspain sobre Tendencias en Formación Virtual:
Conclusiones Jornada Telspain sobre Tendencias en Formación Virtual:
 

More from Matt Harris

HackMIT Presentation
HackMIT PresentationHackMIT Presentation
HackMIT PresentationMatt Harris
 
HackMIT Lightning Talk
HackMIT Lightning TalkHackMIT Lightning Talk
HackMIT Lightning TalkMatt Harris
 
From API to Website
From API to WebsiteFrom API to Website
From API to WebsiteMatt Harris
 
@twitterapi meetup at Paypal Town Hall
@twitterapi meetup at Paypal Town Hall@twitterapi meetup at Paypal Town Hall
@twitterapi meetup at Paypal Town HallMatt Harris
 
Twitter Meetup at the Hacker Dojo
Twitter Meetup at the Hacker DojoTwitter Meetup at the Hacker Dojo
Twitter Meetup at the Hacker DojoMatt Harris
 
Adding timezones into Upcoming feeds
Adding timezones into Upcoming feedsAdding timezones into Upcoming feeds
Adding timezones into Upcoming feedsMatt Harris
 
The eLearning Agenda
The eLearning AgendaThe eLearning Agenda
The eLearning AgendaMatt Harris
 
<Head> Presentation: Plugging Into Wordpress
<Head> Presentation: Plugging Into Wordpress<Head> Presentation: Plugging Into Wordpress
<Head> Presentation: Plugging Into WordpressMatt Harris
 

More from Matt Harris (9)

HackMIT Presentation
HackMIT PresentationHackMIT Presentation
HackMIT Presentation
 
HackMIT Lightning Talk
HackMIT Lightning TalkHackMIT Lightning Talk
HackMIT Lightning Talk
 
From API to Website
From API to WebsiteFrom API to Website
From API to Website
 
@twitterapi meetup at Paypal Town Hall
@twitterapi meetup at Paypal Town Hall@twitterapi meetup at Paypal Town Hall
@twitterapi meetup at Paypal Town Hall
 
Twitter Meetup at the Hacker Dojo
Twitter Meetup at the Hacker DojoTwitter Meetup at the Hacker Dojo
Twitter Meetup at the Hacker Dojo
 
Hackcamp
HackcampHackcamp
Hackcamp
 
Adding timezones into Upcoming feeds
Adding timezones into Upcoming feedsAdding timezones into Upcoming feeds
Adding timezones into Upcoming feeds
 
The eLearning Agenda
The eLearning AgendaThe eLearning Agenda
The eLearning Agenda
 
<Head> Presentation: Plugging Into Wordpress
<Head> Presentation: Plugging Into Wordpress<Head> Presentation: Plugging Into Wordpress
<Head> Presentation: Plugging Into Wordpress
 

Recently uploaded

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

@twitterapi at SocialApp Workshop

  • 2. @twitterapi #appworkshop @themattharris @heroku @heroku TM July 24, 2010 Saturday, July 24, 2010
  • 3. About us TM Saturday, July 24, 2010
  • 4. The team TM Saturday, July 24, 2010
  • 5. @themattharris About me TM Saturday, July 24, 2010
  • 6. What is ? The Twitter Platform TM Saturday, July 24, 2010
  • 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. 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. dev.twitter.com The developer portal TM Saturday, July 24, 2010
  • 10. Creating an app Your own small playground TM Saturday, July 24, 2010
  • 14. Browsing docs TM Saturday, July 24, 2010
  • 18. OAuthpocalypse The day is 30th June 16th August 2010 TM Saturday, July 24, 2010
  • 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. 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. xAuth not XAuth xAuth is OAuth http://dev.twitter.com/pages/xauth TM Saturday, July 24, 2010
  • 22. Check your host! api.twitter.com twitter.com TM Saturday, July 24, 2010
  • 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. 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. Timelines TM Saturday, July 24, 2010
  • 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. Modifiers ‣ include_rts Accepted values: true, 1, t TM Saturday, July 24, 2010
  • 28. Modifiers ‣ include_rts ‣ include_entities Accepted values: true, 1, t TM Saturday, July 24, 2010
  • 29. Modifiers ‣ include_rts ‣ include_entities ‣ trim_user Accepted values: true, 1, t TM Saturday, July 24, 2010
  • 30. Geo TM Saturday, July 24, 2010
  • 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. 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. Get location (if allowed) TM Saturday, July 24, 2010
  • 34. Get location (if allowed) TM Saturday, July 24, 2010
  • 35. /1/geo/search - suggest nearby TM Saturday, July 24, 2010
  • 36. /1/geo/search - suggest nearby TM Saturday, July 24, 2010
  • 37. /1/geo/similar_places - find by name TM Saturday, July 24, 2010
  • 38. /1/geo/similar_places - find by name TM Saturday, July 24, 2010
  • 39. /1/geo/place - not it? create it TM Saturday, July 24, 2010
  • 40. Technical Info ... ‣ /1/geo/similar_places ‣ must run this first to get a creation_token TM Saturday, July 24, 2010
  • 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. More Info... Check out bit.ly/twitter-api-geo TM Saturday, July 24, 2010
  • 43. @anywhere TM Saturday, July 24, 2010
  • 44. Core Features ‣ Hovercards ‣ Tweet Box ‣ Follow Buttons ‣ Linkify ‣ Connect with Twitter TM Saturday, July 24, 2010
  • 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. 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. 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. 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. 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. More Info... Check out bit.ly/anywhere-begin TM Saturday, July 24, 2010
  • 51. Bridge Code @anywhere to api.twitter.com TM Saturday, July 24, 2010
  • 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. 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. 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. 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. 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. 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. 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. 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. Streaming API Near-Realtime Access to Public Statuses TM Saturday, July 24, 2010
  • 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. 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. 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. 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. Streaming API - Default Level ‣ 200 x Keywords ‣ 400 x Follow userids ‣ 10 x 1-degree location boxes TM Saturday, July 24, 2010
  • 66. More Info... Check out bit.ly/streaming_api TM Saturday, July 24, 2010
  • 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. Help... Check out dev.twitter.com TM Saturday, July 24, 2010
  • 69. Questions? Follow us at twitter.com/twitterapi twitter.com/themattharris TM Saturday, July 24, 2010