08 Feb 2010 12:24 pm
s10-Day 06 Introduction to the Flickr API
For day 6, we focused on two items:
- sharing our current project ideas (review Project proposal assignment).
- getting started with Chapter 6 — introduction to APIs via the Flickr API.
I want everyone to keep reading Chapter 6.
Four exercises (due Wednesday, Feb 10 at 5pm)
- Do a Flickr flickr.photos.search query for any term that you like (let me know what it is). Copy and paste the first photo element response and calculate the URL for the context page and the medium size photo. Post your answer as a response to this post.
- Use the Sunlight Labs API to get the names of all of the members of Congress for any zip code outside of the Bay Area. List the members (first name, last name, and bioguide id) of Congress for that zip. Post this answer as a response to this post.
- If you don’t have a Unix account on the I School machines, go to the following url to sign up for one: http://www.ischool.berkeley.edu/arf/ You’ll be able to choose a username and password. You should list me (Raymond Yee) as the sponsor.
- Send me an email with URLs pointing to 1 and 2 and send me your userid for the I School account.
9 Responses to “s10-Day 06 Introduction to the Flickr API”
Leave a Reply
You must be logged in to post a comment.
1. Search term was “Specialized Shiv”
First term in the XML response was:
The URL for the context page is: http://www.flickr.com/photos/25843176@N02 /4059336620/
The medium sized photo is: http://farm3.static.flickr.com/2743/4059336620_bd545ed4d3.jpg
2. For the ZIP code 02139:
http://services.sunlightlabs.com/api/legislators.allForZip.xml?apikey=e7be07492e7a47eab8e0987201cbdb61&zip=02139
yielded:
Michael E. Capuano: C001037
Paul G. Kirk: K000374
John Forbes Kerry: K000148
Shoot, I think I posted my answers in the wrong place. Let me try again…
My Flickr photo search was for “kittens,” using the search request below:
http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key={mysecretAPIkey!don’tlook!}&tags=kittens
The first photo element that I got back from the Flickr Explorer was:
The URL for the context page is:
http://www.flickr.com/photos/22412994@N08/4342013580/
The medium size photo page URL is:
http://farm3.static.flickr.com/2742/4342013580_2b73f0382e.jpg
For the Sunlight Labs exercise, I searched for the legislators in my hometown:
http://services.sunlightlabs.com/api/legislators.allForZip.xml?apikey={mysecretAPIkey!don’tlook!}&zip=46012
They are:
Richard Lugar, bioguide_id=L000504
Mike Pence, bioguide_id=P000587
Evan Bayh, bioguide_id=B001233
For Flickr, I searched for “costarica.” My API call first pulled a photo that Flickr told me had recently been deleted when I tried to do the direct URL (http://www.flickr.com/photos/35269053@N00/4345240206). So, I ended up doing this one:
http://www.flickr.com/photos/41432163@N00/4344499411
http://farm5.static.flickr.com/4063/4344499411_d6566db0d5.jpg
For Sunlight Labs, I pulled the representatives from my hometown (as of earlier this week . . .)
Bill Shuster, bioguide_id= S001154
Robert Casey, bioguide_id= C001070
Arlen Specter, bioguide_id= S000709
John Murtha, bioguide_id= M001120
1) created a search for “party”
The context page is
http://www.flickr.com/photos/74163325@N00/4341159999/
The medium size photo is
http://farm3.static.flickr.com/2772/4341159999_67219b2bb2.jpg
2) zip code 95814 (i used to live here)
Doris Matsui – M001163
Barbara Boxer – B000711
Diane Feinstein – F000062
1. Query = “Gundam”
The context page is,
http://www.flickr.com/photos/39270009@N02/4345706239/
The medium size photo is
http://farm5.static.flickr.com/4009/4345706239_d6c0713a8c.jpg
2. Zip = “91745″
Gary G. Miller: M001139
Diane Feinstein: F000062
Barbara Boxer: B000711
Grace Flores Napolitano: N000179
1. Tag searched for: “laughter”
XML returned for the first image:
Context page for the image:
http://www.flickr.com/photos/43305795@N04/4346146457
Medium sized image:
http://farm3.static.flickr.com/2710/4346146457_8805e4e501_m.jpg
2.
API Call: http://services.sunlightlabs.com/api/legislators.allForZip.xml?apikey=949a33bafda7440495a74f7d5c22fe2f&zip=92101
For the zip code 92101
Susan A Davis Bioguide ID: D000598
Barbara Boxer Bioguide ID: B000711
Dianne Feinstein Bioguide ID: F000062
1)
first photo element response:
context:
http://www.flickr.com/photos/86568343@N00/4347445916/
medium image:
http://farm3.static.flickr.com/2795/4347445916_766a5a06c3.jpg
2)
Christopher Lee, L000568
Charles Schumer, S000148
Kirsten Gillibrand, G000555
Eric Massa, M001173
1. My search term was: “Cheese Board”
The URL is: http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=49558a325ba45b1be2b906471622caa6&tags=Cheese+Board
The URL for the context page is: http://www.flickr.com/photos/11954314@N04/4380341000
The URL for the medium-sized photo is: http://farm5.static.flickr.com/4071/4380341000_f8c0c54cf0.jpg
2. I wanted to see who represents Alpine, NJ – the richest neighborhood in the US. (07620)
http://services.sunlightlabs.com/api/legislators.allForZip.xml?apikey=2a05bacddb4a456da41e00607b194865&zip=07620
Results:
Robert Menendez – M000639
E. Scott Garett – G000548
Frank R. Launtenberg – L000123