Posts Tagged ‘hacking’

Talking about Scripting Enabled and accessibility hacking at Stanford

Friday, August 8th, 2008

Next Thursday, the 14th of August I’ll be guest at Stanford University to give a talk about accessibility hacking and Scripting Enabled.

Get all the details on the Stanford Online Accessibility Program Site

Scripting Enabled Venue and Tickets are now available!

Monday, July 21st, 2008

I’ve met with the lovely people from Gamelab and the Metropolitan University on Friday and we finalized the details of Scripting Enabled.

Scripting Enabled is a two day event in London on the 19th and 20th of September 2008. The goals of the event are:

  • to build accessible interfaces to currently inaccessible services,
  • get hackers and non-technical people who know about accessibility problems to talk and
  • release documentation and tools based on real issues to make the web a more inclusive place.

This event is separated into two different parts and you need to book separate tickets!

The first day is dedicated to getting real information about accessibility barriers of online systems and techniques to work around them. This day is for:

  • Developers that will come on the second day to find out what needs building
  • Anybody who wants to learn about accessibility barriers from those who get blocked by them and not from theory
  • Anybody who wants to share their experiences in being blocked out from online services because of their ability

The second day is a development event where we will try to build solutions and alternative interfaces into existing systems that work around the issues we learned about on the first day.

This day is for:

  • Developers that want to build truly accessible interfaces and legal hacks around currently inaccessible systems
  • People that can give real information based on research and user testing to hep developers build the right things
  • Testers that can give us a real user experience rather than having to simulate it.

Go and book your tickets now

UK Government initiative calls for hackers to mash-up public data

Friday, July 4th, 2008

It is pretty cool to see what is happening right now in the UK when it comes to mashups and data. Show us a better way is a web site and competition that asks ethical hackers to come up with ideas to use a wide range of public data for the good of the public. Straight from the horse’s mouth this sounds like this:

The UK Government wants to hear your ideas for new products that could improve the way public information is communicated. The Power of Information Taskforce is running a competition on the Government’s behalf, and we have a 20,000 pound prize fund to develop the best ideas to the next level. You can see the type of thing we are are looking for here

To show they are serious, the Government is making available gigabytes of new or previously invisible public information especially for people to use in this competition.  Rest assured, this competition does not include personal information about people.

We’re confident that you’ll have more and better ideas than we ever will. You don’t have to have any technical knowledge, nor any money, just a good idea, and 5 minutes spare to enter the competition.

There is a vast amount of APIs available to play with so what stops you from giving it a whirl? My own idea, cabsharing is something I was actually planning to do for quite a time, maybe even as a start-up, but why not here?

Currency conversion API on a shoestring

Saturday, June 21st, 2008

Someone just came to our table at Mashed08 and asked if Yahoo! offers a currency conversion API. We don’t, but a few lines of PHP allows you to get the information from the Yahoo finance site:


function convert($from,$to){
 $url= 'http://finance.yahoo.com/currency/convert?amt=1&from='.$from.'&to='.$to.'&submit=Convert';
 $ch = curl_init();
 curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 $feed = curl_exec($ch);
 curl_close($ch);
 preg_match_all("/tabledata1\">([^<]+)<\/td>/",$feed,$cells);
 return $cells[1][1];
}
echo convert(’USD’,'GBP’);

There’s a whole list of currency codes available on oanda.

A few more lines turns this into a JSON API:


header('Content-type:text/javascript');
$from = $_GET['from'];
$to = $_GET['to'];
$callback = $_GET['callback'];
if(preg_match("/[A-Z|a-z]{3}/",$to) && preg_match("/[A-Z|a-z]{3}/",$from)){
  $to = strToUpper($to);
  $from = strToUpper($from);
  $url= ‘http://finance.yahoo.com/currency/convert?’ .  
        ‘amt=1&from=’.$from.’&to=’.$to.’&submit=Convert’;
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $feed = curl_exec($ch);
  curl_close($ch);
  preg_match_all("/tabledata1\">([^<]+)<\/td>/",$feed,$cells);
  if(is_numeric($cells[1][1])){
    $out = ‘{"from":"’.$from.’","to":"’.$to.’","factor":"’.$cells[1][1].’"}’;
  } else {
    $out = ‘{"error":"Could not convert currencies, are you sure about the names?"}’;
  }
} else {
  $out = ‘{"error":"Invalid Currency format, must be three letters"}’;
}
if(isset($callback)){
  if(preg_match("/[a-z|A-Z|_|-|\$|0-9|\.]/",$callback)){
    $out = $callback.’(’.$out.’)';
  } else {
    $out = ‘{"error":"Invalid callback method name"}’;
  }
}
echo $out;

You have several parameters:

  • from (mandatory): three letter currency code (upper or lower case)
  • to (mandatory): three letter currency code (upper or lower case)
  • callback (optional): the name of the callback method that should be wrapped around the resulting object

If something goes wrong, the API will return an object with an error property, otherwise you’ll get an object with three properties:

  • from: the original currency
  • to: the target currency
  • factor: the conversion factor

Say you store this as convert.php somewhere, then you could do the following:


<script type="text/javascript"> 
  function converted(obj){
    if(obj.error){
      alert(obj.error);
    } else {
      alert('one ' + obj.from + ' is ' + obj.factor + ' ' + obj.to);
    }
  }
</script>
<script type="text/javascript" src="convert.php?from=gbp&to=usd&callback=converted"></script>

This is a terrible dirty hack and if Yahoo finance ever changes their HTML (and they will), this will cease to work.

Building Easy Flickr - Step by Step

Monday, June 16th, 2008

As several people asked how I did the easier Flickr interface, I wrote up some step-by-step instructions, analyzing the issues and then taking the API to work around them.

An easier interface to Flickr

Check out How to create an alternative Flickr interface - step by step.

This is one example where providing a good API can empower developers to remove barriers you might not be aware of for you. I hope to be able to show you more of those in the future.

The code examples are available and are licensed with BSD, so feel free to re-use them.

@mediaAjax
Scripting Enabled - hacking the web to be more accessible - London, England 19th and 20th of September 2008
Wait till I come! is the blog of , a developer evangelist living and working in London, England. Download vcard.

Feed me, Seymour: Entries (RSS) and Comments (RSS).