Twitter API, Streaming and SharePoint 2013

25
Twitter API, Streaming and SharePoint 2013 This is Larry!

description

A presentation hold at the ShareCamp 2013 at Microsoft in Germany about Twitters Streaming API, it's REST APIs and a little bit SharePoint 2013.

Transcript of Twitter API, Streaming and SharePoint 2013

Page 1: Twitter API, Streaming and SharePoint 2013

Twitter API, Streaming and SharePoint 2013

This is Larry!

Page 2: Twitter API, Streaming and SharePoint 2013

DEMORealizing a live twitter wall with twitterizer and put it on a

SharePoint 2013 page.

Page 3: Twitter API, Streaming and SharePoint 2013
Page 4: Twitter API, Streaming and SharePoint 2013

About me

• 25 • SharePoint• Web dev• Consulting

• @hupseb• Employed at - alegri.eu• sharepoint.stackexchange.com• No blog yet Working on it... ;)

Page 5: Twitter API, Streaming and SharePoint 2013

• 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

Page 6: Twitter API, Streaming and SharePoint 2013

Twitter

• 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

Page 7: Twitter API, Streaming and SharePoint 2013

Why you should use it!

Scott Hanselman reads my tweet!

Page 8: Twitter API, Streaming and SharePoint 2013

DEMOPut the twitter widget into a SharePoint 2013 page.

Page 9: Twitter API, Streaming and SharePoint 2013
Page 10: Twitter API, Streaming and SharePoint 2013

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

Page 11: Twitter API, Streaming and SharePoint 2013

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

Page 12: Twitter API, Streaming and SharePoint 2013

Differences between Streaming and REST

© dev.twitter.com

Page 13: Twitter API, Streaming and SharePoint 2013

Differences between Streaming and REST

© dev.twitter.com

Page 14: Twitter API, Streaming and SharePoint 2013

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

Page 15: Twitter API, Streaming and SharePoint 2013

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

Page 16: Twitter API, Streaming and SharePoint 2013

CODELet‘s talk about the code ;) Bits and bytes!

Page 17: Twitter API, Streaming and SharePoint 2013

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

Page 18: Twitter API, Streaming and SharePoint 2013

... 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

Page 19: Twitter API, Streaming and SharePoint 2013

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

Page 20: Twitter API, Streaming and SharePoint 2013
Page 21: Twitter API, Streaming and SharePoint 2013

Thank you...... see you next time! ;)

Page 22: Twitter API, Streaming and SharePoint 2013

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.

Page 23: Twitter API, Streaming and SharePoint 2013

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.

Page 24: Twitter API, Streaming and SharePoint 2013

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

Page 25: Twitter API, Streaming and SharePoint 2013

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...