Download Andrew Mertz Associate Professor of Computer Science Department

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

World Wide Web wikipedia , lookup

Computer Go wikipedia , lookup

Semantic Web wikipedia , lookup

Human-Computer Interaction Institute wikipedia , lookup

Transcript
A Simple Introduction to Web Services Using Flickr
Andrew Mertz
Associate Professor of Computer Science
Department of Mathematics and Computer Science
Eastern Illinois University
Charleston, IL 61920
[email protected]
Many programs use web services to store and access data. Such programs can take advantage of the
fact that often web applications/sites provide developer APIs to programmatically access their services.
While introductory Computer Science classes usually do not include web services as a central topic,
giving a high level overview of them can provide an engaging, relevant, and familiar way of expanding on
GUI design, networking, threading, parsing, and the like. This discussion will focus on building a simple
client for retrieving public images from Flickr.
Flickr (www.flickr.com) is a photo and video sharing site that also functions as an online community.
With more than a million pictures uploaded daily and free accounts including one terabyte of storage,
many students are already familiar with Flickr or similar web services. Like many such services, Flickr
provides a nice set of APIs that developers can access (www.flickr.com/services/api/) and provides API
keys on request.
The sample client (implemented in Java, but adaptable to other languages) allows users to: enter search
strings in a text field, view results of a search as a list image thumbnails, and select a thumbnail image to
load a larger version in the primary panel. To this end students see how to: encode URLs, parse JSON (or
XML depending on preference), use threads to keep the program responsive, indicate to the user that a
long operation is in progress, work with JLists, and read responses from the network (noting how similar
it is to reading from a file). When completed the students have a program they are often eager to show
others and extend. Thus, there are natural follow-up assignments using Flickr APIs other than search
(such as comments or favorites), to use other services such as Google Static Maps, or to combine
different services into something new.