Fun! with the Twitter API

47 %
53 %
Information about Fun! with the Twitter API
Technology

Published on October 1, 2014

Author: ErinShellman

Source: slideshare.net

Description

This was a fun workshop introducing the core functionality of the Twitter API, presented by myself and Stephanie Kim of Seattle PyLadies.

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/ View slide

APIs describe how software communicates • Application Programming Interfaces often come in the form of a module containing specialized classes. View slide

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

Add a comment

Related presentations

Presentación que realice en el Evento Nacional de Gobierno Abierto, realizado los ...

In this presentation we will describe our experience developing with a highly dyna...

Presentation to the LITA Forum 7th November 2014 Albuquerque, NM

Un recorrido por los cambios que nos generará el wearabletech en el futuro

Um paralelo entre as novidades & mercado em Wearable Computing e Tecnologias Assis...

Microsoft finally joins the smartwatch and fitness tracker game by introducing the...

Related pages

Best Practices | Twitter Developers

Best Practices. As you build with ... Using Twitter API with LIFT, ... (Or: Tapping Twitter’s Firehose for Fun and Profit with pandas) by @ptwobrussell ...
Read more

Twitter

Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information. About; Help; Blog; Status; Jobs ...
Read more

Fun statistics with R, Twitter and MongoDB

Fun Analyses with R and Twitter analyzing the MongoDB ... which provides an interface to the Twitter Web API ... (x, preserve_intra_word_dashes = TRUE)) ...
Read more

Twitter Fan Wiki / Apps

I have been playing with a newly released Q&A exchange platform for the Twitter community: TweetBrain . It's hard to categorize it ...
Read more

Twitter Fan Wiki / API Docs

The official API docs live here. Also check out the Twitter developer talk Google Group, and the Twitter API Wiki. Unofficial API Docs . As the official ...
Read more

GET search/tweets | Twitter Developers

Please note that Twitter’s search service and, ... consult our guide to Using the Twitter Search API. ... here in Durham, North Carolina. Fun will ...
Read more

Twitterizer/Twitterizer · GitHub

Twitterizer is a .NET class library that provides an easy-to-use interface for the Twitter web api. ... fun coding, and stretch ... Twitterizer library to ...
Read more

Accessing Twitter from the command line - IBM - United States

... Unauthorized: GET https://api.twitter.com/1/users/search.json ... which your Twitter client lists with every API. Most of all, have fun with Twitter!
Read more