Tweeting tides updated

Almost a year ago I implemented a system that took tidal data which was openly published by Land Information New Zealand for some ports around the country and published them as real-time status updates on Twitter.  Each time there is a high or low tide, a tweet is sent that says what the time is, if it is a high tide or low tide, how high or low the tide is, and when the next tide will arrive.  Other than adding a few more tide tables, I’ve not had to touch the system since then.

Recently however, Twitter made changes to their authentication system which meant that the previous system of simply sending a web request along with a username and password is not accepted anymore.  Instead, clients have to make use of oAuth. I won’t go into this in much detail, other than to say it is a great system for web-based or desktop clients, but for server side scripts that are not used by ‘users’ as such, it is a bit of a pain. Well,several hours of pain, including copying tokens from session cookies etc, but it is working fine now.

Whilst I was fixing this, I thought I’d make use of one of Twitters newer features, the ability to geo-tag tweets.  Since the tide tables relate to specific ports, they make obvious candidates to geo-tag.  I have the longitude and latitude values for each of the ports, so these are now added to the tweets.  These render differently in different twitter clients, but this is how TweetDeck looks:

In case you wanted to see any of the feeds, here they are:


Leave a Reply

Your email address will not be published. Required fields are marked *