Api Introduction

Jun 03, 2013

App Academy W4D1

API Introduction

Today during class we got our first introduction to the web and web programming as well as working with APIs. Probably the best way to learn these things is to jump headfirst into it and start programming! So that is what we did. We got some brief reading about how HTTP and APIs work and then Our second project was a twitter client.

Our two projects today were to create an Ice Cream Shop Tracker and a Twitter Client. A very simple twitter client that works almost entirely within the console IRB. The first project is an ice cream tracker that goes and calls the Google APIs to report to you all the ice cream shops that are within 500 meters of your location. It also told us all the directions that are needed to take in order to reach those shops. It was fun to create something like that and at the end of it I had a real urge to go and use it to find myself some ice cream!

The twitter client is the major project and it let us work with the Twitter API. I at first was worried that I would not be able to read and understand what was going on in the API because the word itself is pretty intimidating but it turned out that the whole project went relatively smoothly. We were able to create a set of classes that created Tweets, parsed tweets from JSON, and call forth a user’s timeline, followeds, and followings. It goes to show you just how well made the Twitter API is.

You can find it here: https://github.com/jonathanstyu/twitterclient

Three Things I learned:

1) PUT, POST, GET, DELETE

2) Oauth and storing oauth keys. Going to the website to authorize an application to make it play well with our application

3) Parsing JSON, which turned out to be the biggest challenge in creating the twitter client app. There is just so much information here in a single tweet that it is very surprising. I at first thought that all twitter was was just a simple text thing with maybe a little bit of meta information. When you go actually pull it up with an API call, you see that that metadata is pretty voluminous

Other Things I Think I Think:

The weather is kind of bizarre. Yesterday it was very hot like 90 degrees. Today it is like 60 degrees frigid and I could feel the hairs on my legs rise on end. This despite the sun outside shining so brightly. Gosh this weather drives me freaking crazy.

LeBron might bring it tonight. Well, he better. I look forward to watching the Miami Cavaliers from 2007 go at it again! Go Pacers. Perhaps they can have Reggie Miller shoot some more threes … oh wait he retired? When did that happen?