Twitter API, Streaming and SharePoint 2013
-
Upload
sebastian-huppmann -
Category
Technology
-
view
6.790 -
download
1
description
Transcript of Twitter API, Streaming and SharePoint 2013
Twitter API, Streaming and SharePoint 2013
This is Larry!
DEMORealizing a live twitter wall with twitterizer and put it on a
SharePoint 2013 page.
About me
• 25 • SharePoint• Web dev• Consulting
• @hupseb• Employed at - alegri.eu• sharepoint.stackexchange.com• No blog yet Working on it... ;)
• Foundation year: 2001
• 225 employees (DACH region)
• 8 locations
• One of the biggest Microsoft-and Unite- (SAP & Microsoft)partners in Germany
• 60+ of DAX 100 companies are our costumers
• Consulting Excellence in MicrosoftEnterprise Solutions
• Alegri.eu
• Social networking and microblogging service• Founded 2006 by Jack Dorsey• Amount of users grows and
grows and...• End of 2011 – 100 million• March 2013 – 1200 million
• 340 million tweets daily• 1.6 billion search queries per
day• business.twitter.com
Why you should use it!
Scott Hanselman reads my tweet!
DEMOPut the twitter widget into a SharePoint 2013 page.
The twitter APIs - overview
• REST APIs – (Representational State Transfer)• Search API • REST API v.1.1 (v.1 depricated – blackout tests running)• In pipeline to unify
• Parameters (count vs. page and rpp)• Object differences
• Poll-based system / pseudo real-time
• Streaming API• Supports long-lived connections on a different architecture• Real-time delivery of tweets
How to search for tweets
• Search API• http://search.twitter.com/search.json?q=twitter• Non authentication possible• Very limited
• REST API v.1.1• https://api.twitter.com/1.1/search/tweets.json• Authentication required
• More queries• Better Limits
Differences between Streaming and REST
© dev.twitter.com
Differences between Streaming and REST
© dev.twitter.com
Streaming API
• Streamed via HTTP• Three streams
• Public stream• User stream• Site stream
• Firehose• Attaching to ALL tweets worldwide• Only for Twitter partners• http://gnip.com/twitter/ Premium twitter streams
• no official volume limit• 400 track keywords, 5,000 follow userids and 25 0.1-360 degree
location boxes
Architecture of TwitterSky
7. Client renders the tweets
3. Authenticate to twitterStreaming API via oAuth.
4. Answer each tweet as a chunk
1. SignalR hub initializes
2. Use Twitterizer to attachto Twitter streaming API
5. Asynchronous notificationof new tweets
6. Pushes tweet to the connected clients
CODELet‘s talk about the code ;) Bits and bytes!
Limits, limits, limits...
• Direct messages: 250 per day• Tweets: 1,000 per day• Changes to account email: 4 per hour• Following: 1,000 per day + aggressive follower block• Following (account-based): Once an account is following 2,000 more
follower are needed to follow more people.
• Reading request from applications:• 150 unauthenticated per hour per IP• Authenticated depends on method that is called:
• https://dev.twitter.com/docs/rate-limiting/1.1• https://dev.twitter.com/docs/rate-limiting/1.1/limits
... limits, limits... limits!
• X-Rate-Limit-Limit:
rate limit ceiling for current request• X-Rate-Limit-Remaining:
number of requests left• X-Rate-Limit-Reset:
the remaining time window before reset
Sources
• https://dev.twitter.com/docs/things-every-developer-should-know• http://speakinghacks.com/• https://dev.twitter.com/docs• https://github.com/Twitterizer/Twitterizer• http://twopcharts.com/twitter1billion.php• http://mashable.com/2009/11/02/twitter-lists-guide/
• @TwitterEng, @twitter, @twitterapi
Thank you...... see you next time! ;)
Search API
• Just two methods search and trends.• Parameters to create advanced searches: location,
language, tweets to/about/from specific users, more.• Retrieve trends, find out what´s hot on twitter
programmatically.
REST API v.1.1
• 87 methods mirroring nearly all of twitter's user-facing features• Returns XML or JSON for all methods, RSS and ATOM for
methods that return timelines.• Supports JSON callbacks, a variety of parameters to
slice 'n dice.• Meaningful use of HTTP response codes, plus
explanatory error messages in the requested format.
Goodies – hotkeys I
• Aktionen
N Neuer Tweet
F Favorisieren
R Antworten
T Retweeten
M Direktnachricht
B Nutzer blockieren
U Nutzer entblocken
Enter Details
L Alle schließen
• Navigation
? Hilfe
J Nächster Tweet
K Vorheriger Tweet
Space Zum Seitenende
/ Suche
. Neue Tweets laden
Goodies – hotkeys II
• Timelines
G H Startseite
G C Verbinden
G A Aktivität
G R Erwähnungen
G D Entdecken
G P Profil
G F Favoriten
G F Favoriten
G L Listen
G M Nachrichten
G S Einstellungen
G U Gehe zu Benutzer...