Highgate Cemetery by Tom Royal on Flickr
Highgate Cemetery by Tom Royal on Flickr
Highgate Cemetery by Tom Royal on Flickr
Highgate Cemetery by Tom Royal on Flickr
Highgate Cemetery by Tom Royal on Flickr
Highgate Cemetery by Tom Royal on Flickr
Highgate Cemetery by Tom Royal on Flickr
Highgate Cemetery by Tom Royal on Flickr
Highgate Cemetery by Tom Royal on Flickr
Osaka by Tom Royal on Flickr

You're using a very old version of Internet Explorer which can't show the photos that should be in this box. Please consider upgrading to a newer version of IE or an alternative such as Firefox. Thanks.

Can you travel to Gatwick Airport using Oyster or Contactless?

April 30th, 2015

No, you can’t. If you try to visit this London airport using Transport for London’s Oyster or Contactless payments, you’ll find a line of ticket inspectors waiting to fine you – and everyone else who makes the same mistake – £20.

Plus you’ll get charged a maximum fare on Oyster or Contactless for not ending your journey.

And that’s despite the Gatwick website saying that both have been valid since 2014.

So, watch out. It’s a nasty setup.

IMG_2931

How To: Push Mag+ MIB files via Automator

March 31st, 2015

automator

At work at Apptitude Media, we make interactive digital magazines, brochures and the like using the Magplus system – both for ourselves, and for clients.

One of the final stages of any project is to send the finished MIB content file to a device for testing – it’s an action we perform several times each day. And there are a few ways to do it, the most convenient of which is the Simple MIB Pusher.

But here’s an even quicker way, if you’re on a Mac.

Open Automator, and create a new Service. Call it something like “Send to iPad”. Set it to receive selected files or folders from Finder.

Drag on the “Run Shell Script” command. Paste the following:

1
2
3
4
while read f
do
curl -X POST -F "file=@$f" http://192.168.1.240:50000
done

.. substituting your device’s IP address in for 192.168.1.240. Save the workflow. You can now send any MIB to your device in one click from the Finder context menu.

Tweet Your Heat: Controlling Nest via Twitter

January 24th, 2015

TBC

How To: Write a RTing Twitter bot in PHP

January 19th, 2015

File this one under “stuff I’ve been meaning to look up for ages”: yesterday I finally sat down and wrote a Twitter-bot. You know the kind – a dedicated account that looks for updates containing a certain word or phrase, then retweets them – I often end up being tweeted by @redscarebot, for example.

Anyhow, here’s how to write your own, in just a few lines of PHP. You’ll need:

1) A server running PHP and MySQL (I set up an Appfog instance)

2) A Twitter account to post from, with a mobile phone number entered in settings

3) A computer somewhere to execute the script every X minutes via CRON

So, with all that in place: download and extra the TwitterOAuth library, then start a new PHP file. Require it:

require "twitteroauth/autoloader.php";
use Abraham\TwitterOAuth\TwitterOAuth;

Register an app at apps.twitter.com, then define the secrets required to access the API in your code:

define('CONSUMER_KEY', 'here');
define('CONSUMER_SECRET', 'here');
define('ACCESS_TOKEN', 'here');
define('ACCESS_TOKEN_SECRET', 'here');

Define your connection:

$twitter = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);

And then you’re ready to make a call to the Twitter API. You’ll probably want to search:

$sstring = '"sleepy cats" OR kittens';
$searchresult = $twitter->get("search/tweets", array("q" => urlencode($sstring), "since_id" => $since, "count" => 100, "result_type" => "recent"));

Note the variable $since – this is the ID of the last tweet processed by the bot on its last execution, used to prevent retweeting the same stuff over and over. Store and retrieve it from MySQL.

You know have $searchresult, and you’ll want to get the tweets out of it:

foreach($searchresult as $tweet) {
$tweettext = $tweet->text;
$tweetid = $tweet->id;
}

.. and you can do whatever you want with those. Want to post a message, probably created by trimming and formatting selected content from the search output? If you have your message in $somestatus

$postthis = $twitter->post("statuses/update", array("status" => $somestatus));

.. and that’s about it. Update your $since ID in MySQL, and close up the PHP file. Call it by CRON every X minutes to check for and retweet new messages.

This is only just barely scratching the surface, of course. Each tweet object contains loads of information that you can process to do more interesting things – see the API reference for details.

The Robot Reporter

January 18th, 2015

Hello. If you’re visiting this post, you’ve probably spotted @theroboreporter on Twitter.

This is an experimental twitter-bot, designed to track breaking news stories by tracing the photos that journalists want to republish.

More details TBC once it’s fully operational.