44. Templates
‣ How information is presented to the user. HTML
with holes poked in it.
‣ Django has a lovely templating system.
‣ hereit.is doesn’t (just PHP includes).
48. Web services allow computers
to talk to each other
BEEP, E-Business XML,
Hessian, JSON-RPC,
Qworum, SOAP, UDDI,
WSDL, WSFL, BPEL, WSCL,
XINS, XLANG, XML-RPC,
OMG WTF BBQ.
49. REST
‣ Representational State Transfer.
‣ Nice and simple.
‣ “The World Wide Web is the key
example of RESTful design.”
50. Resources
‣ The “things” (nouns) that are important
to your application.
‣ Have unique urls.
‣ Often (but not always) map to
database tables/models.
‣ Interact using HTTP methods: GET,
POST, PUT, DELETE (verbs).
51. Representations
‣ How the resource is described.
‣ HTML is a representation.
‣ Other representations may be easier for
machines to understand.
52. hereit.is
‣ Designed around a RESTful
architecture.
‣ One type of resource - the placemark.
‣ Responds correctly to GET, POST,
HEAD, OPTIONS
‣ Needs more work.
53. GET http://hereit.is/brighton
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>hereit.is - short urls for geographical locations</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<!-- Stylesheets -->
<link rel="stylesheet" href="/css/main.css" type="text/css" media="all" />
<!-- Map display scripts -->
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABQIAAAAcdB-
etWpkJ7tBx3xRD6e5hRHLF8DnXNo3WfrkRC1RUZDQQmuaxR0xYg16J7sqocLaYWbfludrEpQiw"></script>
<script type="text/javascript">var placemark =
{"slug":"brighton","latitude":"50.819716","longitude":"-0.136572","zoom":"12","bubble":"Brighton"}</script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/display_map.js"></script>
</head>
<body>
<h1>here it .is</h1>
<h2>Names for Places.</h2>
<div id="beta_badge">beta</div>
<noscript><div class="error_message"><h3>Sorry!</h3><p>Your browser doesn't seem to support JavaScript, or JavaScript is turned off.
You really need JavaScript to use hereit.is.</p></div></noscript>
<div id="map"></div>
<p class="gmaps_link"><a href="http://maps.google.com/?q=50.819716,-0.136572&z=12" title="View on Google Maps">Visit this
location on Google Maps</a></p>
<!-- Google Analytics -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-8869088-1");
pageTracker._trackPageview();
} catch(err) {}</script>