Your SlideShare is downloading. ×
Social Developers London update for Twitter Developers
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Social Developers London update for Twitter Developers

420
views

Published on

Social Developers London Presetation featuring @recorditapp, @STTLibrary, ‏and Real-time demos with Node.js and WebSockets from @romainhuet and Stewart Harper (see links) …

Social Developers London Presetation featuring @recorditapp, @STTLibrary, ‏and Real-time demos with Node.js and WebSockets from @romainhuet and Stewart Harper (see links)

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
420
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Logo https://about.twitter.com/press/brand-assets
  • @recorditapp.
  • https://twitter.com/recorditapp/statuses/479723295550353409

  • Twitter is a global, real-time platform; an indispensable companion to life in the moment. As such, Twitter is a reflection of what’s happening in the world at any given time and the Twitter APIs give developers the opportunity to tap into the pulse of the planet and use that data in innovative ways.
  • What are you going to engage people with about your product/brand/service?

    Using the Twitter Stream API to
  • As you can see on the screenshot, you can expect on average between 50 and 60 Tweets per second (TPS) when connecting to the sample endpoint.

    Twitter see on average 5,700 TPS on the platform, with a record at 143,199 TPS, which is why the complete firehose is very hard to consume without a high-capacity platform behind an application.
  • Beyond the sample, one of the most interesting way to collect Tweets in real time is the filter endpoint, which lets you receive Tweets matching different criteria. Whether you want to track Tweets with some keywords, Tweets from a selection of users, or Tweets posted around a location when users explicitly choose to share it, this endpoint is fascinating since it makes it possible to connect to the pulse of the planet in a way that is relevant to a very specific context.
    The following demo provides a simple interface for the different parameters offered by this endpoint. By sending the selected options such as a hashtag and a bounding box on the map over a WebSocket, the Node server establishes a connection to the filter endpoint which starts streaming Tweets matching at least one of the criteria. For example, on the screenshot below, Tweets containing #WorldCup or sent from a region in Brazil are sent over the WebSocket and displayed on the web page.
  • Transcript

    • 1. Angus Fox Co-Chair Social Developers London @nuxnix This talk draws on information from developers.facebook.com and dev.twitter.com but is in no way endorsed byTwitter Corporation or Facebook Corporation  #justsaying
    • 2. The first places to start are at dev.twitter.com and developers.facebook.com @recorditapp #worldcup • Prototype engagement flow Stream API • Sample • Filter • Context • Heatmap
    • 3. GIF support in theTwitter API NativeTwitter authentication on OS X They use STTwitter - an Objective-C library forTwitter REST API 1.1 and (often overlooked)AppleScript After the user provides credentials, they can then be guaranteed that ourAPI upload of the tweet with a GIF will work. On first use only which makes it really simple to share GIFs. https://github.com/nst/STTwitter @STTLibrary https://twitter.com/recorditapp/statuses/479723295550353409
    • 4. If no such account exists, they use AppleScript plus Apple’s Scripting Bridge: - tell application "System Preferences" activate set the current pane to pane id "com.apple.preferences.internetaccounts" get the name of every anchor of pane id "com.apple.preferences.internetaccounts" reveal anchor "com.apple.twitter.iaplugin" of pane id "com.apple.preferences.internetaccounts" end tell
    • 5. Generates a header file with an API that you can use to communicate with another application using Objective-C code. SystemPreferencesApplication *systemPreferences = [SBApplication applicationWithBundleIdentifier:@"com.apple.systempreferences"]; SystemPreferencesPane *pane = (SystemPreferencesPane *) [[systemPreferences panes] objectWithID:@"com.apple.preferences.internetaccounts"]; SystemPreferencesAnchor *anchor = (SystemPreferencesAnchor *) [[pane anchors] objectWithName:@"com.apple.twitter.iaplugin"]; [systemPreferences activate]; systemPreferences.currentPane = pane; [anchor reveal]
    • 6. Lets talk about the world cup
    • 7. Twitter.Com has had a #worldcup makeover https://twitter.com/i/start/world_cup/choose_tea m After Choosing a team, encourages you to change profile pic https://twitter.com/i/start/world_cup/setup_profile Suggests followers https://twitter.com/i/start/world_cup/follow_team Tweet your support
    • 8. Twitter.Com has had a #worldcup makeover https://twitter.com/i/start/world_cup/choose_tea m After Choosing a team, encourages you to change profile pic https://twitter.com/i/start/world_cup/setup_profile Suggests followers https://twitter.com/i/start/world_cup/follow_team Tweet your support Get Started Add some affinity to your twitter picture Add followers with the same affinity Tweet Support
    • 9. A couple of SampleApps might stimulate your appetite #worldcup • Prototype engagement flow Stream API • Creating an App • Sample Endpoint • Heatmap
    • 10. Streaming APIs are at the cornerstone of the most fascinating products relying onTwitter data.  Analyzing the mood of people in the world  predicting elections  detecting breaking news  providing help to people during emergencies https://blog.twitter.com/2014/connecting-to-the-pulse-of- the-planet-with-twitter-apis https://dev.twitter.com/docs/streaming-apis/streams/public https://github.com/romainhuet/twitter-platform-demos
    • 11. Provides you with roughly 1% of allTweets, randomly selected from the firehose. There are 500 millionTweets posted every single day, so 1% is still a very large number and statistically relevant for many use cases. https://dev.twitter.com/docs/api/1.1/get/statuse s/sample DEMO OAuth signing results
    • 12. The filter endpoint, lets you receiveTweets matching different criteria to trackTweets  with some keywords,  from a selection of users  around a location when users explicitly choose to share it
    • 13. Stream geo-tagged tweets using Node.js The end result is a real-time heat map depicting where in the world people are tweeting from Download it from github http://blog.safe.com/2014/03/twitter-stream- api-map/  March 25, 2014 - Stewart Harper
    • 14. Package.json holds a variety of metadata related to the project and lists dependencies. Server.js is where all of the logic lies.This code first sets up a web server using express, which serves the static web pages, loads socket.io the web socket module, and loads theTwitterAPI module.
    • 15. You must create an application onTwitter. Set the API keys to those in the twitterAPI tab.  API key > consumer_key  API secret > consumer_secret  Access token > access_token_key  Access token secret > access_token_secret
    • 16. The client mapping application connects to the web socket server and triggers the connection listener. Another listener, start tweets, is set up and a connected message is sent to the client telling them they are connected and everything is ready. When the client receives this message, it sends a message to the start tweets listener and theTweets get streamed.  We only want to streamTweets with location, so they are parsed, and if they have coordinates we create a simple piece of JSON containing the location.
    • 17. This sets up the Google Map then opens up a websocket connection with the server. Once the server confirms it has received the connection and is ready to start sendingTweets, the connected listener is called and the client sends a message back to the server to say it is ready via socket.emit(“start tweets”);. The server responds with a stream ofTweets captured in the twitter-stream listener, where they are added to an array bound to a Google Maps heat layer.
    • 18. Presentations are available from Slideshare Slides http://www.slideshare.net/nuxnix

    ×