I have been involved in a whole bunch of projects, both professionally and personally, which require interacting with third party APIs by calling web service endpoints.

I had to do this a lot, and essentially I found myself cutting and pasting the same bits of code about from project to project. This is obviously bad, so I took the time one morning to wrap up the code into a reusable library, and as a good open source citizen, I stuck it on Github.

Example usage

The library lets you specify an web service object, and bind it to an endpoint. You can then talk to this object and get various PHP data structures back.

Currently I’ve only written a JSON endpoint object, but it’d be easy enough to define classes to handle other formats.

e.g.

require_once('Webservice.php');
require_once('JSONWebservice.php');

$json = new \simple_webservice\JSONWebservice('https://example.com/rest/');

$result = $json->get('path/to/query', ['param1' => 'foo', 'param2' => 'bar']);

Enjoy!

» Visit the project on Github...

Quick post to point out a tiny tool that I’ve found useful while hacking together various webby thing that use and expose open graph meta tags and microformats.

It’s a VERY simple tool, that when passed a URL, will mine the page for Open Graph and Microformat data (using my Open Graph library, and Barnaby Walter’s fantastic MF2 parser). You can even execute it from the command line if you have the CLI version on your path, which I find handy.

Anyway, code on github, and you can see it running on skunk.

» See it running on skunk…

» Visit the project on Github...

Over the past few weeks it seems that Twitter has been moving to drastically redefine what the service is about. Moving to limit API connections and placing restrictions on how third parties interface with it.

This has limited the usefulness of third party tools that others love and risks damaging the ecosystem that has built up around the service – although, as I have remarked in the past, building a business around a single third party service is asking for trouble.

Now, there must be sound business reason why the folks at the big blue bird decided to do this but I can’t help feeling that they’re missing an opportunity to reach out to these developers.

Twitter is more than a messaging service, it’s a protocol. It’s a way of loosely connecting services together without having to write a specific connection mechanism, for example, this is how I get IFTTT updating my todo list.

It would be a real shame to see the utility of this sacrificed in order to turn Twitter into just another eyeball engine for adverts. Thankfully, other systems exist, and my hope is that we will see a more distributed ecosystem evolve.

Update 20/9/12: Got an email from IFTTT today, and it seems that they are being forced to remove all Twitter triggers from their service. Which means no more archiving, or traffic updates among other things. I’m sure this must all make sense from a business point of view, but it seems a crying shame to systematically make the service less useful to people.

Image “Fail Whale” by Yiling Lu