SlideShare a Scribd company logo
1 of 33
Download to read offline
Fun! with the Twitter API 
Stephanie Kim, @stephlkim 
Erin Shellman, @erinshellman 
! 
June 30, 2014 
Seattle PyLadies presents…
Every other Monday. 
http://www.meetup.com/Seattle-PyLadies/
Intro to Python 
http://www.meetup.com/Girl-Develop-It-Seattle/
APIs describe how 
software communicates 
• Application Programming Interfaces often come in 
the form of a module containing specialized 
classes.
REST APIs interface consumers 
with resources on a server 
• Representational state transfer (REST) 
• REST APIs are specifications of remote calls 
exposed to API consumers. 
1. Separate client from server. 
2. Stateless. 
3. Use HTTP/HTTPS.
What could you build?
OAuth 
OAuth is an open standard that 
allows us to access protected 
resources hosted by a resource 
server. 
https://dev.twitter.com/docs/auth/authorizing-request
Lets get some tokens! 
https://apps.twitter.com/
Reading documentation is 90% 
https://dev.twitter.com/docs/api/1.1
Request verbs 
• There are 5 common methods a client can apply to a 
resource: 
• GET 
• HEAD 
• POST 
• PUT 
• DELETE
The anatomy of a request 
• Request Line - Tells the server what type of 
request is being sent (e.g. GET, POST, PUT, DELETE) 
• Header - Send over any required values, like 
security tokens. 
• Body - What resource are you asking for?
request line 
header 
body
Responses 
• A successful request to the server results in a 
response, hopefully containing the resource you 
requested. 
• The response will contain a 3-digit status code 
starting with 1, 2, 3, 4, or 5.
Response Codes 
• 1__: Working on the request. 
• 2__: Everything’”⁹s cool. 
• 3__: Everything’”⁹s cool, but something else is 
happening. 
• 4__: Oh man, not cool. 
• 5__: The server errored out. 
See: https://dev.twitter.com/docs/error-codes-responses
The response also has a 
response line, header and body 
• Similarly to the request, a response contains a 
response line, a header and a body.
https://github.com/Seattle-PyLadies/TwitterApiWorkshop
https://dev.twitter.com/docs/api/1.1/get/statuses/retweets_of_me
https://dev.twitter.com/docs/api/1.1/post/statuses/update
Make your own!
Teaser for next time: 
http://it-stinks.herokuapp.com/
Resources 
1. Programmable Web. http:// 
www.programmableweb.com/ 
2. Designing a RESTful API with Flask. http:// 
blog.miguelgrinberg.com/post/designing-a-restful-api-with- 
python-and-flask 
3. Cool mashups made possible with APIs. http:// 
mashable.com/2009/10/08/top-mashups/ 
4. Great book about REST APIs. http://www.amazon.com/ 
RESTful-Web-APIs-Leonard-Richardson-ebook/dp/ 
B00F5BS966

More Related Content

What's hot

API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonTEST Huddle
 
利用 Appium + Robot Framework 實現跨平台 App 互動測試
利用 Appium + Robot Framework 實現跨平台 App 互動測試利用 Appium + Robot Framework 實現跨平台 App 互動測試
利用 Appium + Robot Framework 實現跨平台 App 互動測試Jeremy Kao
 
4 Major Advantages of API Testing
4 Major Advantages of API Testing4 Major Advantages of API Testing
4 Major Advantages of API TestingQASource
 
Pentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang BhatnagarPentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang BhatnagarOWASP Delhi
 
Automated API pentesting using fuzzapi
Automated API pentesting using fuzzapiAutomated API pentesting using fuzzapi
Automated API pentesting using fuzzapiAbhijeth D
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API TestingBruno Pedro
 
Slideshare API
Slideshare APISlideshare API
Slideshare APIboucher
 
An Introduction To Automated API Testing
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API TestingSauce Labs
 
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...Simplilearn
 
Mobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason HugginsMobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason HugginsSauce Labs
 
Cucumber questions
Cucumber questionsCucumber questions
Cucumber questionsShivaraj R
 
API Test Automation Tips and Tricks
API Test Automation Tips and TricksAPI Test Automation Tips and Tricks
API Test Automation Tips and Trickstesthive
 
Testing APIs in the Cloud
Testing APIs in the CloudTesting APIs in the Cloud
Testing APIs in the CloudSmartBear
 

What's hot (20)

Api testing
Api testingApi testing
Api testing
 
API Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj RollisonAPI Testing: The heart of functional testing" with Bj Rollison
API Testing: The heart of functional testing" with Bj Rollison
 
利用 Appium + Robot Framework 實現跨平台 App 互動測試
利用 Appium + Robot Framework 實現跨平台 App 互動測試利用 Appium + Robot Framework 實現跨平台 App 互動測試
利用 Appium + Robot Framework 實現跨平台 App 互動測試
 
API World Conference
API World ConferenceAPI World Conference
API World Conference
 
Belajar Postman test runner
Belajar Postman test runnerBelajar Postman test runner
Belajar Postman test runner
 
Cucumber with appium
Cucumber with appiumCucumber with appium
Cucumber with appium
 
4 Major Advantages of API Testing
4 Major Advantages of API Testing4 Major Advantages of API Testing
4 Major Advantages of API Testing
 
Pentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang BhatnagarPentesting Rest API's by :- Gaurang Bhatnagar
Pentesting Rest API's by :- Gaurang Bhatnagar
 
Automated API pentesting using fuzzapi
Automated API pentesting using fuzzapiAutomated API pentesting using fuzzapi
Automated API pentesting using fuzzapi
 
What's new in Rails 4.1
What's new in Rails 4.1What's new in Rails 4.1
What's new in Rails 4.1
 
How to Automate API Testing
How to Automate API TestingHow to Automate API Testing
How to Automate API Testing
 
Slideshare API
Slideshare APISlideshare API
Slideshare API
 
An Introduction To Automated API Testing
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API Testing
 
Api Testing
Api TestingApi Testing
Api Testing
 
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
Selenium Interview Questions And Answers | Selenium Interview Questions | Sel...
 
Mobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason HugginsMobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason Huggins
 
Souvik_CV
Souvik_CVSouvik_CV
Souvik_CV
 
Cucumber questions
Cucumber questionsCucumber questions
Cucumber questions
 
API Test Automation Tips and Tricks
API Test Automation Tips and TricksAPI Test Automation Tips and Tricks
API Test Automation Tips and Tricks
 
Testing APIs in the Cloud
Testing APIs in the CloudTesting APIs in the Cloud
Testing APIs in the Cloud
 

Similar to Fun! with the Twitter API

Building Social Tools
Building Social ToolsBuilding Social Tools
Building Social ToolsAnand Hemmige
 
A RESTful Interface for Erlang Code using Webmachine
A RESTful Interface for Erlang Code using WebmachineA RESTful Interface for Erlang Code using Webmachine
A RESTful Interface for Erlang Code using WebmachineOnorioCatenacci
 
Api fundamentals
Api fundamentalsApi fundamentals
Api fundamentalsAgileDenver
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
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 sleepMike Anderson
 
Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017JoEllen Carter
 
Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Patrick Savalle
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with ODataMahek Merchant
 
Создание API, которое полюбят разработчики. Глубокое погружение
Создание API, которое полюбят разработчики. Глубокое погружениеСоздание API, которое полюбят разработчики. Глубокое погружение
Создание API, которое полюбят разработчики. Глубокое погружениеSQALab
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayAmazon Web Services
 
Documenting REST APIs
Documenting REST APIsDocumenting REST APIs
Documenting REST APIsTom Johnson
 
Logical Attacks(Vulnerability Research)
Logical Attacks(Vulnerability Research)Logical Attacks(Vulnerability Research)
Logical Attacks(Vulnerability Research)Ajay Negi
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Brian Huff
 

Similar to Fun! with the Twitter API (20)

Building Social Tools
Building Social ToolsBuilding Social Tools
Building Social Tools
 
API Docs with OpenAPI 3.0
API Docs with OpenAPI 3.0API Docs with OpenAPI 3.0
API Docs with OpenAPI 3.0
 
A RESTful Interface for Erlang Code using Webmachine
A RESTful Interface for Erlang Code using WebmachineA RESTful Interface for Erlang Code using Webmachine
A RESTful Interface for Erlang Code using Webmachine
 
Api fundamentals
Api fundamentalsApi fundamentals
Api fundamentals
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
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
 
Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017
 
Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)Super simple introduction to REST-APIs (2nd version)
Super simple introduction to REST-APIs (2nd version)
 
Rest WebAPI with OData
Rest WebAPI with ODataRest WebAPI with OData
Rest WebAPI with OData
 
Facebook & Twitter API
Facebook & Twitter APIFacebook & Twitter API
Facebook & Twitter API
 
Создание API, которое полюбят разработчики. Глубокое погружение
Создание API, которое полюбят разработчики. Глубокое погружениеСоздание API, которое полюбят разработчики. Глубокое погружение
Создание API, которое полюбят разработчики. Глубокое погружение
 
flask.pptx
flask.pptxflask.pptx
flask.pptx
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
Why should I care about REST?
Why should I care about REST?Why should I care about REST?
Why should I care about REST?
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API Gateway
 
Documenting REST APIs
Documenting REST APIsDocumenting REST APIs
Documenting REST APIs
 
Logical Attacks(Vulnerability Research)
Logical Attacks(Vulnerability Research)Logical Attacks(Vulnerability Research)
Logical Attacks(Vulnerability Research)
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)
 
API SECURITY
API SECURITYAPI SECURITY
API SECURITY
 

More from Erin Shellman

Case studies in data-driven merchandising
Case studies in data-driven merchandisingCase studies in data-driven merchandising
Case studies in data-driven merchandisingErin Shellman
 
Building Robust Pipelines with Airflow
Building Robust Pipelines with AirflowBuilding Robust Pipelines with Airflow
Building Robust Pipelines with AirflowErin Shellman
 
Catching the most with high-throughput screening
Catching the most with high-throughput screeningCatching the most with high-throughput screening
Catching the most with high-throughput screeningErin Shellman
 
Developing effective data scientists
Developing effective data scientistsDeveloping effective data scientists
Developing effective data scientistsErin Shellman
 
Downloading the internet with Python + Scrapy
Downloading the internet with Python + ScrapyDownloading the internet with Python + Scrapy
Downloading the internet with Python + ScrapyErin Shellman
 
Collaborative Filtering for fun ...and profit!
Collaborative Filtering for fun ...and profit!Collaborative Filtering for fun ...and profit!
Collaborative Filtering for fun ...and profit!Erin Shellman
 
Assumptions: Check yo'self before you wreck yourself
Assumptions: Check yo'self before you wreck yourselfAssumptions: Check yo'self before you wreck yourself
Assumptions: Check yo'self before you wreck yourselfErin Shellman
 

More from Erin Shellman (9)

Case studies in data-driven merchandising
Case studies in data-driven merchandisingCase studies in data-driven merchandising
Case studies in data-driven merchandising
 
Building Robust Pipelines with Airflow
Building Robust Pipelines with AirflowBuilding Robust Pipelines with Airflow
Building Robust Pipelines with Airflow
 
Catching the most with high-throughput screening
Catching the most with high-throughput screeningCatching the most with high-throughput screening
Catching the most with high-throughput screening
 
Developing effective data scientists
Developing effective data scientistsDeveloping effective data scientists
Developing effective data scientists
 
Bot or Not
Bot or NotBot or Not
Bot or Not
 
Downloading the internet with Python + Scrapy
Downloading the internet with Python + ScrapyDownloading the internet with Python + Scrapy
Downloading the internet with Python + Scrapy
 
real time real talk
real time real talkreal time real talk
real time real talk
 
Collaborative Filtering for fun ...and profit!
Collaborative Filtering for fun ...and profit!Collaborative Filtering for fun ...and profit!
Collaborative Filtering for fun ...and profit!
 
Assumptions: Check yo'self before you wreck yourself
Assumptions: Check yo'self before you wreck yourselfAssumptions: Check yo'self before you wreck yourself
Assumptions: Check yo'self before you wreck yourself
 

Recently uploaded

QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneUiPathCommunity
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - AvrilIvanti
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfROWELL MARQUINA
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 

Recently uploaded (20)

QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
How Tech Giants Cut Corners to Harvest Data for A.I.
How Tech Giants Cut Corners to Harvest Data for A.I.How Tech Giants Cut Corners to Harvest Data for A.I.
How Tech Giants Cut Corners to Harvest Data for A.I.
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyone
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - Avril
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 

Fun! with the Twitter API

  • 1. Fun! with the Twitter API Stephanie Kim, @stephlkim Erin Shellman, @erinshellman ! June 30, 2014 Seattle PyLadies presents…
  • 2.
  • 3. Every other Monday. http://www.meetup.com/Seattle-PyLadies/
  • 4. Intro to Python http://www.meetup.com/Girl-Develop-It-Seattle/
  • 5. APIs describe how software communicates • Application Programming Interfaces often come in the form of a module containing specialized classes.
  • 6.
  • 7.
  • 8. REST APIs interface consumers with resources on a server • Representational state transfer (REST) • REST APIs are specifications of remote calls exposed to API consumers. 1. Separate client from server. 2. Stateless. 3. Use HTTP/HTTPS.
  • 9. What could you build?
  • 10.
  • 11. OAuth OAuth is an open standard that allows us to access protected resources hosted by a resource server. https://dev.twitter.com/docs/auth/authorizing-request
  • 12. Lets get some tokens! https://apps.twitter.com/
  • 13. Reading documentation is 90% https://dev.twitter.com/docs/api/1.1
  • 14. Request verbs • There are 5 common methods a client can apply to a resource: • GET • HEAD • POST • PUT • DELETE
  • 15. The anatomy of a request • Request Line - Tells the server what type of request is being sent (e.g. GET, POST, PUT, DELETE) • Header - Send over any required values, like security tokens. • Body - What resource are you asking for?
  • 17. Responses • A successful request to the server results in a response, hopefully containing the resource you requested. • The response will contain a 3-digit status code starting with 1, 2, 3, 4, or 5.
  • 18. Response Codes • 1__: Working on the request. • 2__: Everything’”⁹s cool. • 3__: Everything’”⁹s cool, but something else is happening. • 4__: Oh man, not cool. • 5__: The server errored out. See: https://dev.twitter.com/docs/error-codes-responses
  • 19. The response also has a response line, header and body • Similarly to the request, a response contains a response line, a header and a body.
  • 21.
  • 22.
  • 23.
  • 25.
  • 27.
  • 28.
  • 29.
  • 30.
  • 32. Teaser for next time: http://it-stinks.herokuapp.com/
  • 33. Resources 1. Programmable Web. http:// www.programmableweb.com/ 2. Designing a RESTful API with Flask. http:// blog.miguelgrinberg.com/post/designing-a-restful-api-with- python-and-flask 3. Cool mashups made possible with APIs. http:// mashable.com/2009/10/08/top-mashups/ 4. Great book about REST APIs. http://www.amazon.com/ RESTful-Web-APIs-Leonard-Richardson-ebook/dp/ B00F5BS966