topical media & game development
mashup-delicious-14-rally2007-save-popup.php / php
<?php
//configure del.icio.us username and password
define('DELICIOUS_USERNAME','USERNAME');
define('DELICIOUS_PASSWORD','PASSWORD');
//bring in the Snoopy and configure
require('lib/Snoopy.class.php');
//bring in del.icio.us mashups lib
require('lib/delicious_mashups.inc.php');
//the default tag meant to identify all posts to the rally project
define('DEFAULT_TAG',"rally2007");
//the Yahoo Maps Web Service geocoding API URL
define('YAHOO_GEOCODING_API_URL','http://api.local.yahoo.com/MapsService/V1/geocode');
//your Yahoo Application ID
define('YAHOO_APP_ID','YOURAPPLICATIONID');
if (isset(response = ''; //will contain the success/error message from posting
//assemble API method arguments
_POST['url'] != "")
_POST['url']);
else
die("Sorry - URL is required!");
//description
if (arguments .= "&description=".urlencode(arguments .= "&extended=".urlencode(arguments .= "&tags=".urlencode(DEFAULT_TAG." "._POST['address'] != '') {
_POST['address'])."&output=php";
geocode_request);
snoopy->results);
if (isset(arguments .= urlencode(" geotagged geo:lat=".geocode_results['ResultSet']['Result']['Longitude']);
}
}
//save the link to del.icio.us
do_api_call('/posts/add?',response to indicate whether we got a favorable response or not
if (response = "Sorry, but there was an error. Code: ".response = "Saved succesfully!";
}
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Save to Rally Website</title>
</head>
<body>
<h3>Save this page to the Rally project website.</h3>
<?php
if (!isset(_GET['location'])) { echo _GET['title'])) { echo response; ?></div>
<div align="center">
<a href="#" onclick="window.close()">[ Close this Window ]</a>
</div>
<?php
}
?>
</body>
</html>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.