Recent Changes - Search:

Network Programming

This website demonstrates using wikis as teaching and learning tool.

The course instructor is happy to share the teaching materials here with those who find it readable.

Network Programming Assignment Two for Academic Year 2009-2010

Assignment Two (Due date: March 30, 2010)

Introduction: There are a number of photo-sharing web services that enables users to upload hundreds of photos and embed each photo with various information such as descriptive words and geographical data. This assignment is about making use of these useful resources to do something useful and interesting.

Your tasks: Develop a program in any languages you like (Java, PHP, JavaScript) that meets the following requirements.

  • It access the Web Services APIs of one or more photo-sharing websites to search photos.
  • Function One: It accepts a pair of latitude and longitude (e.g. '22.275250,114.180397') and finds the recent photos that were taken around that particular area.
  • Function Two: It accepts an address (e.g. '香港銅鑼灣怡和街28號' ) and finds the recent photos that were taken around that particular area.
  • Function Three: It accepts a place name (e.g. '香港公開大學' ) and finds the recent photos that were taken around that particular area.
  • It displays the following information in each photo: the photo in small size (such as 75 by 75 pixels), the author, the link to the original photo.

Resources and References


A sampe UI for your consideration


A PHP template for your work:

<?php
  $ll = strip_tags(trim($_GET['ll']));
  $address = strip_tags(trim($_GET['address']));
  $place = strip_tags(trim($_GET['place']));
  $has_input = false;
  if ($ll != '') {
    $address = '';
    $place = '';
    $has_input = true;
  } elseif ($address != '') {
    $place = '';
    $has_input = true;
  } elseif ($place != '') {
    $has_input = true;
  }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Test Web Service API with PHP</title>
<style type="text/css" media="screen">
body {text-align:center; font-family:Georgia, "Times New Roman", Times, serif;}
img {margin:10px;border:2px solid #555;}
.imageDisplay {margin:auto;width:500px;}
.imageDisplay a {text-decoration:none;}
</style>
</head>
<body>
<?php if ($has_input) { ?>
<h1>User's Input:
<?php if ($ll != '') echo $ll; ?>
<?php if ($address != '') echo $address; ?>
<?php if ($place != '') echo $place; ?>
</h1>
<div class="imageDisplay">
<a href="" title=""><img src="http://farm1.static.flickr.com/216/472799243_470f4d10eb_s.jpg" width="75" height="75" alt="" /></a>
<a href="" title=""><img src="http://farm1.static.flickr.com/220/468761648_2e6f59f528_s.jpg" width="75" height="75" alt="" /></a>
<a href="" title=""><img src="http://farm4.static.flickr.com/3607/3322358257_9596ba2c2e_s.jpg" width="75" height="75" alt="" /></a>
<a href="" title=""><img src="http://farm3.static.flickr.com/2129/2168723796_7375671b68_s.jpg" width="75" height="75" alt="" /></a>
<a href="" title=""><img src="http://farm1.static.flickr.com/40/87032852_f6550fcd08_s.jpg" width="75" height="75" alt="" /></a>
<a href="" title=""><img src="http://farm3.static.flickr.com/2555/4097921345_3b7ac03a8a_s.jpg" width="75" height="75" alt="" /></a>
<a href="" title=""><img src="http://farm3.static.flickr.com/2074/1850284935_97bd9c5926_s.jpg" width="75" height="75" alt="" /></a>
<a href="" title=""><img src="http://farm4.static.flickr.com/3011/3049957274_0df4befb02_s.jpg" width="75" height="75" alt="" /></a>
<a href="" title=""><img src="http://farm4.static.flickr.com/3598/3692682369_04960b370a_s.jpg" width="75" height="75" alt="" /></a>
<a href="" title=""><img src="http://farm4.static.flickr.com/3484/3726476084_75647202ec_s.jpg" width="75" height="75" alt="" /></a>
<a href="" title=""><img src="http://farm4.static.flickr.com/3619/3479135723_7a905bfc09_s.jpg" width="75" height="75" alt="" /></a>
<a href="" title=""><img src="http://farm1.static.flickr.com/203/511020082_df2b26b5b4_s.jpg" width="75" height="75" alt="" /></a>
</div>
<?php } else { ?>
<h1>No Input, Do Nothing</h1>
<?php } ?>
<p>This work is by Steven choy on 2010-02-04</p>
</body>
</html>

Edit - History - Print - Recent Changes - Search
Page last modified on February 04, 2010, at 10:57 AM