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...

Further to my previous post on embedding Idno posts, I’ve written a WordPress plugin to make the process even easier!

Now, you can embed a post in your blog by placing the permalink of the blog inside the new [idno] shortcode, for example:

[idno]http://mysite.com/permalink[/idno]

or, to override the default size of the embed code:

[idno width="somesize" height="somesize"]http://mysite.com/permalink[/idno]

» Visit the project on Github…