Channel Your Vision [Jan. 25, 2012, 9:01 p.m.]
This task is about getting familiar with the Twitter Application Programming Interface, or API. Load up the Twitter API docs
If you click on this link you should a JSON-formatted response in your browser. (You may want to stop and marvel at how cool it is that this is literally just a bunch of plain old text that Twitter's servers just sent you, and that you can use this important plumbing to build fantastic and wonderful web applications of untold complexity). Try adding different arguments to the url, as outlined in the docs. That's not too hard, eh?
Answer these questions as you go.
-
What are some of the fields returned in the user_timeline API call? What are some of the different data types (eg. string, date, integer...)
-
What happens when you try to submit an API call that is broken?
-
What specific API call will you use for your search query?
-
There are many different types of HTTP requests: GET, POST, PUT, etc. What kind of request are you issuing? (Feel free to research this question to determine the right answer).
-
A "path style" API call looks like example.com/api/username/search/search-term. An argument-style query uses argument strings such as example.com/api?person=username&search=search_term. How are Twitter's queries constructed? Can these formats be combined? Why might you use one versus the other in different circumstances? (Note that these questions are the subject of endless discussions amongst web developers. There is some well-known wisdom here but not necessarily a "right" answer, so treat these questions as fodder for discussion and raising new questions-- and don't spend TOO much time on it).
-
You will often hear people describe the Twitter (and other) APIs as "rest-ful." What makes something a "restful" API?
Once you're done with these, you should feel comfortable formatting query parameters, submitting queries in your browser, and visually parsing long ugly blurbs of JSON text. Hooray! On to the next task.