SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Linked Data &
  Semantic Web
  Technology




Development of Twitter Applications
                  Part 1. Overview


                    Dr. Myungjin Lee
What is Twitter?
      • An information network
                – a real-time information network that connects you to the latest stories,
                  ideas, opinions and news about what you find interesting
                – using small bursts of information called Tweets with 140 characters long
                – 400 million tweet-per-day (June 6, 2012)


      • Open Source base
                – built on open source software, from the back-end to the front-end
                – https://dev.twitter.com/opensource/thanks




                                                                                             2
Linked Data & Semantic Web Technology
How is Twitter Different from Other Social Tools?




      • not symmetrical                 • symmetrical
        (nonreciprocal relationships)
      • inherent openness               • “walled garden”, protected
                                          information
      • cannot edit, just can delete    • can edit and delete



                                                                       3
Linked Data & Semantic Web Technology
Twitter Terms
      •       Twitter
                –     the service that can communicate with anyone else
      •       Tweets
                –     messages of 140 characters or fewer
      •       Follower
                –     someone who opts in to receive your tweets
      •       Following
                –     the people whose tweets you opt in to receive
      •       @reply
                –     a public message typically sent as a response to a previous Tweet
      •       Direct messages (DMs)
                –     a message sent privately to one of your followers
      •       Private account
                –     an account whose tweets are not public
      •       Trending topics
                –     the most popular terms on Twitter at a moment in time
      •       Retweets (RTs)
                –     when users find an interesting tweet and share it with their followers
      •       Hashtag
                –     the convention of flagging a word with the hash character #topic to aid with keyword search and the
                      tagging of discussions



                                                                                                                            4
Linked Data & Semantic Web Technology
Quiz
      1. Why is there a character limit in a tweet?
                A. Twitter decided that’s long enough for a thought.
                B. Twitter wanted to save on server space.
                C. There is a hard-character limit on SMS.


      2. True or False: There are two types of accounts on Twitter: one
         that is open and another that is closed.

      3. What is a direct message, or DM?
                A. A tweet that doesn’t go through Twitter’s server.
                B. A private tweet that goes only to the person you are sending it to.
                C. A message that comes from Twitter corporate


                                                                                         5
Linked Data & Semantic Web Technology
Services for Twitter Applications
      • Twitter for Websites
                – a suit of products that enables websites to easily integrate Twitter, such as the Like
                  button and the Follow button

      • Search API
                – for products looking to allow a user to query for Twitter content
                – finding a set of tweets with specific keywords, finding tweets referencing a specific
                  user, or finding tweets from a particular user

      • REST API
                – to access some of the core primitives of Twitter including timelines, status updates, and
                  user information
                – offering programmatic access to the timeline, status, and user objects

      • Streaming API
                – the real-time sample of the Twitter Firehose
                – low-latency high volume access to Tweets
                – to establish a long-lived HTTP connection and maintain that connection



                                                                                                              6
Linked Data & Semantic Web Technology
Differences between Streaming and REST
  REST API




                                          Streaming API




                                                          7
Linked Data & Semantic Web Technology
Registering Your Application

                                        • https://dev.twitter.com/apps/new

                                        • Application Details
                                            – Name
                                                • your application name
                                            – Description
                                                • your application description
                                            – Website
                                                • your application’s publicly
                                                  accessible home page
                                            – Callback URL
                                                • webpage URL where twitter
                                                  returns after successfully
                                                  authenticating




                                                                                 8
Linked Data & Semantic Web Technology
Registering Your Application




                                        9
Linked Data & Semantic Web Technology
OAuth Process for Desktop Application




                                              10
Linked Data & Semantic Web Technology
OAuth Process for Web Application




                                          11
Linked Data & Semantic Web Technology
HTTP Status Codes
     Code                 Text                                                                Description
      200                  OK            Success!
      304            Not Modified        There was no new data to return.
                                         The request was invalid. An accompanying error message will explain why. This is the status code will be returned
      400             Bad Request        during version 1.0 rate limiting. In API v1.1, a request without authentication is considered invalid and you will get
                                         this response.
      401            Unauthorized        Authentication credentials were missing or incorrect.
                                         The request is understood, but it has been refused or access is not allowed. An accompanying error message will
      403              Forbidden
                                         explain why. This code is used when requests are being denied due to update limits.
                                         The URI requested is invalid or the resource requested, such as a user, does not exists. Also returned when the
      404              Not Found
                                         requested format is not supported by the requested method.
      406           Not Acceptable       Returned by the Search API when an invalid format is specified in the request.
                                         This resource is gone. Used to indicate that an API endpoint has been turned off. For example: "The Twitter REST
      410                 Gone
                                         API v1 will soon stop functioning. Please migrate to API v1.1."
      420        Enhance Your Calm       Returned by the version 1 Search and Trends APIs when you are being rate limited.
      422       Unprocessable Entity     Returned when an image uploaded to POST account/update_profile_banner is unable to be processed.
                                         Returned in API v1.1 when a request cannot be served due to the application's rate limit having been exhausted for
      429        Too Many Requests
                                         the resource.
      500        Internal Server Error   Something is broken. Please post to the group so the Twitter team can investigate.
      502            Bad Gateway         Twitter is down or being upgraded.
      503        Service Unavailable     The Twitter servers are up, but overloaded with requests. Try again later.
      504          Gateway timeout       The Twitter servers are up, but the request couldn't be serviced due to some failure within our stack. Try again later.


                                                                                                                                                                   12
Linked Data & Semantic Web Technology
Error Messages and Codes
      • When the Twitter API returns error messages, it does so in your
        requested format.
                {"errors":[{"message":"Sorry, that page does not exist","code":34}]}



       Code                             Text                                                        Description

         32         Could not authenticate you        Your call could not be completed as dialed.

         34         Sorry, that page does not exist   Corresponds with an HTTP 404 - the specified resource was not found.

         88         Rate limit exceeded               The request limit for this resource has been reached for the current rate limit window.

         89         Invalid or expired token          The access token used in the request is incorrect or has expired. Used in API v1.1

        130         Over capacity                     Corresponds with an HTTP 503 - Twitter is temporarily over capacity.

        131         Internal error                    Corresponds with an HTTP 500 - An unknown internal error occurred.

                                                      Corresponds with a HTTP 401 - it means that your oauth_timestamp is either ahead or behind our
        135         Could not authenticate you
                                                      acceptable range

                                                      Typically sent with 1.1 responses with HTTP code 400. The method requires authentication but it
        215         Bad authentication data
                                                      was not presented or was wholly invalid.



                                                                                                                                                        13
Linked Data & Semantic Web Technology
Twitter Out of the Box
      • Basic Limits for Twitter Applications
                –     1,000 total updates per day, on any and all devices
                –     250 total direct messages per day, on any and all devices
                –     Changes to account email: Four per hour
                –     Following (daily): The technical follow limit is 1,000 per day.
                –     Following (account-based): An account is following 2,000 other users.


      • Whitelisting
                – to provide developers with an increase from 150 to 20,000 requests per
                  hour
                – however, no longer grant whitelisting request




                                                                                              14
Linked Data & Semantic Web Technology
Rate Limiting
      • REST API Rate Limiting
                – Default rate limit for calls to the REST API
                          • Unauthenticated calls are permitted 150 request per hour against the public facing
                            IP of the server or device.
                          • OAuth calls are permitted 350 requests per hour against the oauth_token
                – Invalid OAuth information the API
                          • For methods which require authentication, the API will return an error response.
                          • For methods which can be requested unauthenticated, the request will count
                            against the unauthenticated rate limit.
                – API methods to submit data using HTTP POST are not rate limited.


      • Search API Rate Limiting
                – higher than the REST Rate Limit, sufficient for most application


      • Streaming API
                – rate limiting and access level that are appropriate for long-lived connections

                                                                                                                 15
Linked Data & Semantic Web Technology
Rate Limiting
      • Knowing if you are rate limited
                – If your application is being rate-limited by the REST API, it will receive
                  HTTP 400 response codes.
                – If you are rate limited on the Search or Streaming APIs, an HTTP 420
                  response code will be returned.


      • Blacklisting
                – If you or your application abuses the rate limits we will blacklist it.
                          1. If you are using the REST API, make a call to the GET
                             application/rate_limit_status from the account or computer
                             which is blacklisted.
                          2. Explain why you think your application was blacklisted.
                          3. Describe in detail how you have fixed the problem that you think caused you
                             to be blacklisted.



                                                                                                           16
Linked Data & Semantic Web Technology
Rate Limiting
      • Checking the rate limit
                – Response headers
                          • the current rate status in the response header

                                  X-RateLimit-Limit: 350
                                  X-RateLimit-Remaining: 350
                                  X-RateLimit-Reset: 1277485629




                – Request your rate limits from the API
                          • an API call to /1.1/application/rate_limit_status.xml or
                            /1.1/application/rate_limit_status.json

                                  {"reset_time_in_seconds"=>1277485629,
                                   "remaining_hits"=>350,
                                   "hourly_limit"=>350,
                                   "reset_time"=>"Fri Jun 25 17:07:09 +0000 2010"}




                                                                                       17
Linked Data & Semantic Web Technology
Things Every Developer Should Know
      • Tweet IDs are enormous and break javascript
                – use the id_str field instead of id

      • The API is entirely HTTP-based
                – basically, require a GET request
                – a POST request to submit, change, or destroy data
                – a DELETE request to destroy data

      • The API is a RESTful resource
                – to support XML, JSON, and the RSS and Atom syndication formats

      • Parameters have certain expectations
                – two things to keep in mind
                          • Parameter values should be converted to UTF-8 and URL encoded.
                          • The page parameter begins at 1, not 0.
                – two special parameters in the Twitter API
                          • callback: to wraps response in a callback method of your choice
                          • suppress_response_codes: If this parameter is present, all responses will be returned
                            with a 200 OK status code – even errors.


                                                                                                                    18
Linked Data & Semantic Web Technology
Twitter Libraries
      •       Clojure                                           •   Objective-C
                –     twitter-api                                    –     FHSTwitterEngine
      •       ColdFusion                                        •   Perl
                –     MonkehTweet Twitter API                        –     Net::Twitter
      •       .NET                                              •   PHP
                –     LINQ2Twitter                                   –     tmhOAuth
                –     Spring.NET Social extension for Twitter        –     twitteroauth
                –     TweetSharp                                     –     140dev Twitter Framework
      •       Go                                                     –     codebird-php
                –     twittergo                                 •   Python
      •       Java                                                   –     tweepy
                –     Twitter4J                                      –     python-twitter
      •       Javascript / node.js                              •   Ruby
                –     user-stream                                    –     Twitter
                –     codebird-js                                    –     Twitter Console
      •       Lua/Corona SDK                                         –     TweetStream
                –     Twitter Facade




                                                                                                      19
Linked Data & Semantic Web Technology
Exploring the Twitter API
    https://apigee.com/embed/console/twitter




                                               20
Linked Data & Semantic Web Technology
References
      •       Christoper Peri, Sams Teach Yourself the Twitter API in 24 Hours, SAMS, June 2011.
      •       https://twitter.com/about
      •       http://www.theverge.com/2012/6/6/3069424/twitter-400-million-total-daily-tweets
      •       https://dev.twitter.com/opensource
      •       https://dev.twitter.com/start
      •       https://apigee.com/embed/console/twitter




                                                                                                   21
Linked Data & Semantic Web Technology

Weitere ähnliche Inhalte

Andere mochten auch

Twitter applications
Twitter applicationsTwitter applications
Twitter applications
Newplans
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
tameemyousaf
 

Andere mochten auch (13)

Development of Twitter Application #5 - Users
Development of Twitter Application #5 - UsersDevelopment of Twitter Application #5 - Users
Development of Twitter Application #5 - Users
 
Digital Photo Workshop
Digital Photo WorkshopDigital Photo Workshop
Digital Photo Workshop
 
Twitter applications
Twitter applicationsTwitter applications
Twitter applications
 
Twitter and Medical Education: Information and Inspiration
Twitter and Medical Education: Information and InspirationTwitter and Medical Education: Information and Inspiration
Twitter and Medical Education: Information and Inspiration
 
Lambda Architecture - Storm, Trident, SummingBird ... - Architecture and Over...
Lambda Architecture - Storm, Trident, SummingBird ... - Architecture and Over...Lambda Architecture - Storm, Trident, SummingBird ... - Architecture and Over...
Lambda Architecture - Storm, Trident, SummingBird ... - Architecture and Over...
 
Sequence Diagram
Sequence DiagramSequence Diagram
Sequence Diagram
 
Data Flow Diagram and Sequence Diagram
Data Flow Diagram and Sequence DiagramData Flow Diagram and Sequence Diagram
Data Flow Diagram and Sequence Diagram
 
KERNAL ARCHITECTURE
KERNAL ARCHITECTUREKERNAL ARCHITECTURE
KERNAL ARCHITECTURE
 
Diagrams
DiagramsDiagrams
Diagrams
 
What is Kernel, basic idea of kernel
What is Kernel, basic idea of kernelWhat is Kernel, basic idea of kernel
What is Kernel, basic idea of kernel
 
Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagram
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare ppt
 

Ähnlich wie Development of Twitter Application #1 - Overview

Ähnlich wie Development of Twitter Application #1 - Overview (20)

Mz twitter-1.1-sdl
Mz twitter-1.1-sdlMz twitter-1.1-sdl
Mz twitter-1.1-sdl
 
Twitter api
Twitter apiTwitter api
Twitter api
 
OAuth
OAuthOAuth
OAuth
 
Spring Social - Messaging Friends & Influencing People
Spring Social - Messaging Friends & Influencing PeopleSpring Social - Messaging Friends & Influencing People
Spring Social - Messaging Friends & Influencing People
 
CSE5656 Complex Networks - Gathering Data from Twitter
CSE5656 Complex Networks - Gathering Data from TwitterCSE5656 Complex Networks - Gathering Data from Twitter
CSE5656 Complex Networks - Gathering Data from Twitter
 
Appsworld - Mobilize your SharePoint with WinWire
Appsworld - Mobilize your SharePoint with WinWireAppsworld - Mobilize your SharePoint with WinWire
Appsworld - Mobilize your SharePoint with WinWire
 
Data Collection from Social Media Platforms
Data Collection from Social Media PlatformsData Collection from Social Media Platforms
Data Collection from Social Media Platforms
 
Twitter
TwitterTwitter
Twitter
 
Oauth2.0
Oauth2.0Oauth2.0
Oauth2.0
 
Social Media Data Collection & Analysis
Social Media Data Collection & AnalysisSocial Media Data Collection & Analysis
Social Media Data Collection & Analysis
 
Harvesting Data from Twitter Workshop: Hands-on Experience
Harvesting Data from Twitter Workshop: Hands-on ExperienceHarvesting Data from Twitter Workshop: Hands-on Experience
Harvesting Data from Twitter Workshop: Hands-on Experience
 
Leverage Social Media Data with SAP Data Services
Leverage Social Media Data with SAP Data ServicesLeverage Social Media Data with SAP Data Services
Leverage Social Media Data with SAP Data Services
 
Beyond Social – Tailor SharePoint 2013 Social features according to your need...
Beyond Social – Tailor SharePoint 2013 Social features according to your need...Beyond Social – Tailor SharePoint 2013 Social features according to your need...
Beyond Social – Tailor SharePoint 2013 Social features according to your need...
 
oauth-for-credentials-security-in-rest-api-access
oauth-for-credentials-security-in-rest-api-accessoauth-for-credentials-security-in-rest-api-access
oauth-for-credentials-security-in-rest-api-access
 
Creating a RESTful api without losing too much sleep
Creating a RESTful api without losing too much sleepCreating a RESTful api without losing too much sleep
Creating a RESTful api without losing too much sleep
 
Building A Great API - Evan Cooke, Cloudstock, December 2010
Building A Great API - Evan Cooke, Cloudstock, December 2010Building A Great API - Evan Cooke, Cloudstock, December 2010
Building A Great API - Evan Cooke, Cloudstock, December 2010
 
DotNet 2019 | Hugo Biarge - Autenticación en aplicaciones web y nativas
DotNet 2019 | Hugo Biarge - Autenticación en aplicaciones web y nativasDotNet 2019 | Hugo Biarge - Autenticación en aplicaciones web y nativas
DotNet 2019 | Hugo Biarge - Autenticación en aplicaciones web y nativas
 
Reaching 1 Million APIs and what to do when we get there
Reaching 1 Million APIs and what to do when we get thereReaching 1 Million APIs and what to do when we get there
Reaching 1 Million APIs and what to do when we get there
 
Twet
TwetTwet
Twet
 
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
OAuth 2.0 and Mobile Devices: Is that a token in your phone in your pocket or...
 

Mehr von Myungjin Lee

Mehr von Myungjin Lee (20)

지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
지식그래프 개념과 활용방안 (Knowledge Graph - Introduction and Use Cases)
 
JSP 프로그래밍 #05 HTML과 JSP
JSP 프로그래밍 #05 HTML과 JSPJSP 프로그래밍 #05 HTML과 JSP
JSP 프로그래밍 #05 HTML과 JSP
 
JSP 프로그래밍 #04 JSP 의 기본
JSP 프로그래밍 #04 JSP 의 기본JSP 프로그래밍 #04 JSP 의 기본
JSP 프로그래밍 #04 JSP 의 기본
 
JSP 프로그래밍 #03 서블릿
JSP 프로그래밍 #03 서블릿JSP 프로그래밍 #03 서블릿
JSP 프로그래밍 #03 서블릿
 
JSP 프로그래밍 #02 서블릿과 JSP 시작하기
JSP 프로그래밍 #02 서블릿과 JSP 시작하기JSP 프로그래밍 #02 서블릿과 JSP 시작하기
JSP 프로그래밍 #02 서블릿과 JSP 시작하기
 
JSP 프로그래밍 #01 웹 프로그래밍
JSP 프로그래밍 #01 웹 프로그래밍JSP 프로그래밍 #01 웹 프로그래밍
JSP 프로그래밍 #01 웹 프로그래밍
 
관광 지식베이스와 스마트 관광 서비스 (Knowledge base and Smart Tourism)
관광 지식베이스와 스마트 관광 서비스 (Knowledge base and Smart Tourism)관광 지식베이스와 스마트 관광 서비스 (Knowledge base and Smart Tourism)
관광 지식베이스와 스마트 관광 서비스 (Knowledge base and Smart Tourism)
 
오픈 데이터와 인공지능
오픈 데이터와 인공지능오픈 데이터와 인공지능
오픈 데이터와 인공지능
 
법령 온톨로지의 구축 및 검색
법령 온톨로지의 구축 및 검색법령 온톨로지의 구축 및 검색
법령 온톨로지의 구축 및 검색
 
도서관과 Linked Data
도서관과 Linked Data도서관과 Linked Data
도서관과 Linked Data
 
공공데이터, 현재 우리는?
공공데이터, 현재 우리는?공공데이터, 현재 우리는?
공공데이터, 현재 우리는?
 
LODAC 2017 Linked Open Data Workshop
LODAC 2017 Linked Open Data WorkshopLODAC 2017 Linked Open Data Workshop
LODAC 2017 Linked Open Data Workshop
 
Introduction of Deep Learning
Introduction of Deep LearningIntroduction of Deep Learning
Introduction of Deep Learning
 
쉽게 이해하는 LOD
쉽게 이해하는 LOD쉽게 이해하는 LOD
쉽게 이해하는 LOD
 
서울시 열린데이터 광장 문화관광 분야 LOD 서비스
서울시 열린데이터 광장 문화관광 분야 LOD 서비스서울시 열린데이터 광장 문화관광 분야 LOD 서비스
서울시 열린데이터 광장 문화관광 분야 LOD 서비스
 
LOD(Linked Open Data) Recommendations
LOD(Linked Open Data) RecommendationsLOD(Linked Open Data) Recommendations
LOD(Linked Open Data) Recommendations
 
Interlinking for Linked Data
Interlinking for Linked DataInterlinking for Linked Data
Interlinking for Linked Data
 
Linked Open Data Tutorial
Linked Open Data TutorialLinked Open Data Tutorial
Linked Open Data Tutorial
 
Linked Data Usecases
Linked Data UsecasesLinked Data Usecases
Linked Data Usecases
 
공공데이터와 Linked open data
공공데이터와 Linked open data공공데이터와 Linked open data
공공데이터와 Linked open data
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

Development of Twitter Application #1 - Overview

  • 1. Linked Data & Semantic Web Technology Development of Twitter Applications Part 1. Overview Dr. Myungjin Lee
  • 2. What is Twitter? • An information network – a real-time information network that connects you to the latest stories, ideas, opinions and news about what you find interesting – using small bursts of information called Tweets with 140 characters long – 400 million tweet-per-day (June 6, 2012) • Open Source base – built on open source software, from the back-end to the front-end – https://dev.twitter.com/opensource/thanks 2 Linked Data & Semantic Web Technology
  • 3. How is Twitter Different from Other Social Tools? • not symmetrical • symmetrical (nonreciprocal relationships) • inherent openness • “walled garden”, protected information • cannot edit, just can delete • can edit and delete 3 Linked Data & Semantic Web Technology
  • 4. Twitter Terms • Twitter – the service that can communicate with anyone else • Tweets – messages of 140 characters or fewer • Follower – someone who opts in to receive your tweets • Following – the people whose tweets you opt in to receive • @reply – a public message typically sent as a response to a previous Tweet • Direct messages (DMs) – a message sent privately to one of your followers • Private account – an account whose tweets are not public • Trending topics – the most popular terms on Twitter at a moment in time • Retweets (RTs) – when users find an interesting tweet and share it with their followers • Hashtag – the convention of flagging a word with the hash character #topic to aid with keyword search and the tagging of discussions 4 Linked Data & Semantic Web Technology
  • 5. Quiz 1. Why is there a character limit in a tweet? A. Twitter decided that’s long enough for a thought. B. Twitter wanted to save on server space. C. There is a hard-character limit on SMS. 2. True or False: There are two types of accounts on Twitter: one that is open and another that is closed. 3. What is a direct message, or DM? A. A tweet that doesn’t go through Twitter’s server. B. A private tweet that goes only to the person you are sending it to. C. A message that comes from Twitter corporate 5 Linked Data & Semantic Web Technology
  • 6. Services for Twitter Applications • Twitter for Websites – a suit of products that enables websites to easily integrate Twitter, such as the Like button and the Follow button • Search API – for products looking to allow a user to query for Twitter content – finding a set of tweets with specific keywords, finding tweets referencing a specific user, or finding tweets from a particular user • REST API – to access some of the core primitives of Twitter including timelines, status updates, and user information – offering programmatic access to the timeline, status, and user objects • Streaming API – the real-time sample of the Twitter Firehose – low-latency high volume access to Tweets – to establish a long-lived HTTP connection and maintain that connection 6 Linked Data & Semantic Web Technology
  • 7. Differences between Streaming and REST REST API Streaming API 7 Linked Data & Semantic Web Technology
  • 8. Registering Your Application • https://dev.twitter.com/apps/new • Application Details – Name • your application name – Description • your application description – Website • your application’s publicly accessible home page – Callback URL • webpage URL where twitter returns after successfully authenticating 8 Linked Data & Semantic Web Technology
  • 9. Registering Your Application 9 Linked Data & Semantic Web Technology
  • 10. OAuth Process for Desktop Application 10 Linked Data & Semantic Web Technology
  • 11. OAuth Process for Web Application 11 Linked Data & Semantic Web Technology
  • 12. HTTP Status Codes Code Text Description 200 OK Success! 304 Not Modified There was no new data to return. The request was invalid. An accompanying error message will explain why. This is the status code will be returned 400 Bad Request during version 1.0 rate limiting. In API v1.1, a request without authentication is considered invalid and you will get this response. 401 Unauthorized Authentication credentials were missing or incorrect. The request is understood, but it has been refused or access is not allowed. An accompanying error message will 403 Forbidden explain why. This code is used when requests are being denied due to update limits. The URI requested is invalid or the resource requested, such as a user, does not exists. Also returned when the 404 Not Found requested format is not supported by the requested method. 406 Not Acceptable Returned by the Search API when an invalid format is specified in the request. This resource is gone. Used to indicate that an API endpoint has been turned off. For example: "The Twitter REST 410 Gone API v1 will soon stop functioning. Please migrate to API v1.1." 420 Enhance Your Calm Returned by the version 1 Search and Trends APIs when you are being rate limited. 422 Unprocessable Entity Returned when an image uploaded to POST account/update_profile_banner is unable to be processed. Returned in API v1.1 when a request cannot be served due to the application's rate limit having been exhausted for 429 Too Many Requests the resource. 500 Internal Server Error Something is broken. Please post to the group so the Twitter team can investigate. 502 Bad Gateway Twitter is down or being upgraded. 503 Service Unavailable The Twitter servers are up, but overloaded with requests. Try again later. 504 Gateway timeout The Twitter servers are up, but the request couldn't be serviced due to some failure within our stack. Try again later. 12 Linked Data & Semantic Web Technology
  • 13. Error Messages and Codes • When the Twitter API returns error messages, it does so in your requested format. {"errors":[{"message":"Sorry, that page does not exist","code":34}]} Code Text Description 32 Could not authenticate you Your call could not be completed as dialed. 34 Sorry, that page does not exist Corresponds with an HTTP 404 - the specified resource was not found. 88 Rate limit exceeded The request limit for this resource has been reached for the current rate limit window. 89 Invalid or expired token The access token used in the request is incorrect or has expired. Used in API v1.1 130 Over capacity Corresponds with an HTTP 503 - Twitter is temporarily over capacity. 131 Internal error Corresponds with an HTTP 500 - An unknown internal error occurred. Corresponds with a HTTP 401 - it means that your oauth_timestamp is either ahead or behind our 135 Could not authenticate you acceptable range Typically sent with 1.1 responses with HTTP code 400. The method requires authentication but it 215 Bad authentication data was not presented or was wholly invalid. 13 Linked Data & Semantic Web Technology
  • 14. Twitter Out of the Box • Basic Limits for Twitter Applications – 1,000 total updates per day, on any and all devices – 250 total direct messages per day, on any and all devices – Changes to account email: Four per hour – Following (daily): The technical follow limit is 1,000 per day. – Following (account-based): An account is following 2,000 other users. • Whitelisting – to provide developers with an increase from 150 to 20,000 requests per hour – however, no longer grant whitelisting request 14 Linked Data & Semantic Web Technology
  • 15. Rate Limiting • REST API Rate Limiting – Default rate limit for calls to the REST API • Unauthenticated calls are permitted 150 request per hour against the public facing IP of the server or device. • OAuth calls are permitted 350 requests per hour against the oauth_token – Invalid OAuth information the API • For methods which require authentication, the API will return an error response. • For methods which can be requested unauthenticated, the request will count against the unauthenticated rate limit. – API methods to submit data using HTTP POST are not rate limited. • Search API Rate Limiting – higher than the REST Rate Limit, sufficient for most application • Streaming API – rate limiting and access level that are appropriate for long-lived connections 15 Linked Data & Semantic Web Technology
  • 16. Rate Limiting • Knowing if you are rate limited – If your application is being rate-limited by the REST API, it will receive HTTP 400 response codes. – If you are rate limited on the Search or Streaming APIs, an HTTP 420 response code will be returned. • Blacklisting – If you or your application abuses the rate limits we will blacklist it. 1. If you are using the REST API, make a call to the GET application/rate_limit_status from the account or computer which is blacklisted. 2. Explain why you think your application was blacklisted. 3. Describe in detail how you have fixed the problem that you think caused you to be blacklisted. 16 Linked Data & Semantic Web Technology
  • 17. Rate Limiting • Checking the rate limit – Response headers • the current rate status in the response header X-RateLimit-Limit: 350 X-RateLimit-Remaining: 350 X-RateLimit-Reset: 1277485629 – Request your rate limits from the API • an API call to /1.1/application/rate_limit_status.xml or /1.1/application/rate_limit_status.json {"reset_time_in_seconds"=>1277485629, "remaining_hits"=>350, "hourly_limit"=>350, "reset_time"=>"Fri Jun 25 17:07:09 +0000 2010"} 17 Linked Data & Semantic Web Technology
  • 18. Things Every Developer Should Know • Tweet IDs are enormous and break javascript – use the id_str field instead of id • The API is entirely HTTP-based – basically, require a GET request – a POST request to submit, change, or destroy data – a DELETE request to destroy data • The API is a RESTful resource – to support XML, JSON, and the RSS and Atom syndication formats • Parameters have certain expectations – two things to keep in mind • Parameter values should be converted to UTF-8 and URL encoded. • The page parameter begins at 1, not 0. – two special parameters in the Twitter API • callback: to wraps response in a callback method of your choice • suppress_response_codes: If this parameter is present, all responses will be returned with a 200 OK status code – even errors. 18 Linked Data & Semantic Web Technology
  • 19. Twitter Libraries • Clojure • Objective-C – twitter-api – FHSTwitterEngine • ColdFusion • Perl – MonkehTweet Twitter API – Net::Twitter • .NET • PHP – LINQ2Twitter – tmhOAuth – Spring.NET Social extension for Twitter – twitteroauth – TweetSharp – 140dev Twitter Framework • Go – codebird-php – twittergo • Python • Java – tweepy – Twitter4J – python-twitter • Javascript / node.js • Ruby – user-stream – Twitter – codebird-js – Twitter Console • Lua/Corona SDK – TweetStream – Twitter Facade 19 Linked Data & Semantic Web Technology
  • 20. Exploring the Twitter API https://apigee.com/embed/console/twitter 20 Linked Data & Semantic Web Technology
  • 21. References • Christoper Peri, Sams Teach Yourself the Twitter API in 24 Hours, SAMS, June 2011. • https://twitter.com/about • http://www.theverge.com/2012/6/6/3069424/twitter-400-million-total-daily-tweets • https://dev.twitter.com/opensource • https://dev.twitter.com/start • https://apigee.com/embed/console/twitter 21 Linked Data & Semantic Web Technology