Showing posts with label google. Show all posts
Showing posts with label google. Show all posts

Tuesday, June 23, 2009

Open Australian Government - Ideas

Australia now has a government 2.0 taskforce.

AUD $2.45 million of funding to web 2.0-ify the Australian government.

Here's some ideas, to get you started:

CrimeTweet - A twitter like application, based on identi.ca, Google Maps API, and Zemanta.

Our local police force has someone publishing crimes on the front page of their website, which is also fed out to newspapers.

Why not provide an identi.ca client which lets you tweet about crimes?
Use a tool like Zemanta to linkify keywords, and google maps API to add an approximate geolocation (say, street level accurate). You add in structured data (RDFa?) too.

Effort? I'd peg it at 2 months to get it polished; and then it's a matter of getting police forces to use it.

Benefits: A much tighter integration with citizen police groups (neighbourhood watch), and the ability to do crime maps / analyze the data.


Idea 2: As above, but expand it out to neighbourhood watch people, give them easy tools to upload photos of minor crimes (ie, graffiti).


Idea 3: Stolen goods register, powered by Freebase.
You use a Freebase suggest control to help people tag consumer goods / get pictures of said goods, plus a bit of storage for serial numbers and descriptions.

You provide RSS feeds / emails to all local pawn shops, cash convertors, etc.

Reblog this post [with Zemanta]

Sunday, January 25, 2009

Using Image_Graph neatly

Here are my two best tips around using Image_Graph for projects. They aren't necessarily right, but have worked fantastically for me.

Use it like Google Chart API (on demand)


Build a simple page which takes a number of arguments via GET variables, and serves up an image. You can then use simple commands to render whatever you like.

# Rendering code:
require_once 'Net/URL.php';
function make_graph_url($data) {

$url = new Net_URL('graph.php');
$url->gt;querystring['data'] = $data;
$url->gt;querystring['type'] = 'pie';
return $url->gt;getURL(); // "graph.php?type=pie&data[Cats]=1&data[Fish]=2";
}

# HTML / Presentation bit
<img src="%3C?php%20print%20make_graph_url%28$data%29;%20?%3E" alt="Graph of Cats and Fish" />

#Graph.php
require_once 'Image/Graph.php';

$graph = new Image_Graph();
// read in $_GET and construct your graph

$graph->gt;done();


Its worth thinking about maintaining a pretty similar approach to google's API, so that you can swap one for the other almost trivially.

Pre-rendering


Say you have a set of reports you must run. The amount of data is huge, so you really don't want to try and do things on the fly. You have to update the data periodically - ie, once a week or month.

Steps here:
1. Denormalize in the database - precalculate answers and render them into tables. It will save you loads of time.
2. When you have the data you need, pre-render the graphs and save them to disk. Do it with an easy naming scheme.

Now when someone hits your pages to look at information, you've got everything already there - its a matter of wiring it together.


These two things are pretty obvious and self explanatory, but worth keeping in mind. The last thing you want to do is build a page which assembles data, then realize Image_Graph renders in a different stream (ie, not inline), and resort to copy and paste coding.


Reblog this post [with Zemanta]

Wednesday, August 01, 2007

Google Maps to have microformats

Microformats in Google Maps.

Pretty neat. If you don't know what this means, I'll tell you.

You would:
  • Search for pizza in collinswood
  • Find your favourite pizza place
  • Click a button
  • Add it magically to your address book
Want to see how? Go and install Operator, and then do the above steps.

Monday, May 14, 2007

How to build a route planner in 3 steps

  1. Learn about scriptaculous, and sortables
  2. Know that google maps allows you to input multiple to addresses
  3. Use a sortable list to quickly sort of a list of addresses into a route for your busy end users.


Here's the result.

<!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>Route planning example</title>
<script src="http://script.aculo.us/prototype.js" type="text/javascript"></script>
<script src="http://script.aculo.us/scriptaculous.js" type="text/javascript"></script>
<style type="text/css">
#routes {
cursor: pointer;
}
</style>
<script type="text/javascript">
function buildLink(ol) {
var items = $A(ol.getElementsByTagName('li'));
var url = 'http://maps.google.com/maps?q=';
var i = 0;

url += escape('from:');
items.each(function(item) {
if (i++ > 0) {
url += escape(' to:');
}
url += escape(item.textContent);
});

return url;
}

function updateLink() {
$('link').href = buildLink($('routes'));
}
</script>
</head>
<body>
<h1>Planning my Routes</h1>
<ol id="routes">
<li>38 Fife St, Klemzig, South Australia</li>
<li>132 Greenhill Rd, Unley, South Australia</li>
<li>18 Stephen St, Mt Barker, South Australia</li>
<li>19 Young St, Unley, South Australia</li>
</ol>
<a id="link" href="">Show routes</a>
<script type="text/javascript">
Sortable.create("routes", {onChange: updateLink});
window.onload = updateLink;
</script>
</body>
</html>


If you were given a presorted list of your appointments over the day, this list lets you start doing them in less than a second.

Wednesday, February 14, 2007

Belgium, meet robots.txt

An article about Belgium really annoyed me today.

Take a peep at the rant on dotherightthing.com, and see what you think.

Friday, October 14, 2005

Heh: Google is *so* doing this goal

I wonder what he’ll be able to do if he can get a few more googlers using their 20% project time on gaim?

Google’s just hired Sean Egan (the main developer of Gaim open IM client), just the same day Yahoo! and Microsoft plan to link their respective proprietary IM networks.” From the post: “While Yahoo! and Microsoft link their proprietary networks for Instant Messaging, Google bets on Open Protocols to make information universally accessible … Currently, Google uses XMPP/Jabber specs, but they claim to be supporting open server-to-server federation, and work “to hear from other people in the communications industry about how best to build a federation model that is open, scalable”. In fact, there are this month several tests with firms like EarthLink, Sipphone or PeopleCall.


Article