Social Developers London update for Twitter Developers

Download Social Developers London update for Twitter Developers

Post on 19-Aug-2015




1 download

Embed Size (px)


  1. 1. Angus Fox Co-Chair Social Developers London @nuxnix This talk draws on information from and but is in no way endorsed byTwitter Corporation or Facebook Corporation #justsaying
  2. 2. The first places to start are at and @recorditapp #worldcup Prototype engagement flow Stream API Sample Filter Context Heatmap
  3. 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. @STTLibrary
  4. 4. If no such account exists, they use AppleScript plus Apples Scripting Bridge: - tell application "System Preferences" activate set the current pane to pane id "" get the name of every anchor of pane id "" reveal anchor "" of pane id "" end tell
  5. 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:@""]; SystemPreferencesPane *pane = (SystemPreferencesPane *) [[systemPreferences panes] objectWithID:@""]; SystemPreferencesAnchor *anchor = (SystemPreferencesAnchor *) [[pane anchors] objectWithName:@""]; [systemPreferences activate]; systemPreferences.currentPane = pane; [anchor reveal]
  6. 6. Lets talk about the world cup
  7. 7. Twitter.Com has had a #worldcup makeover m After Choosing a team, encourages you to change profile pic Suggests followers Tweet your support
  8. 8. Twitter.Com has had a #worldcup makeover m After Choosing a team, encourages you to change profile pic Suggests followers Tweet your support Get Started Add some affinity to your twitter picture Add followers with the same affinity Tweet Support
  9. 9. A couple of SampleApps might stimulate your appetite #worldcup Prototype engagement flow Stream API Creating an App Sample Endpoint Heatmap
  10. 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 the-planet-with-twitter-apis
  11. 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. s/sample DEMO OAuth signing results
  12. 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. 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 api-map/ March 25, 2014 - Stewart Harper
  14. 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 the web socket module, and loads theTwitterAPI module.
  15. 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. 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. 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. 18. Presentations are available from Slideshare Slides