Malleable Musings

April 25, 2009

Cli.gs and the iPhone – Part 3 (Twitterfon)

Filed under: cli.gs, iphone, PHP, simple hacks — Tags: , , — Brendan @ 10:04 pm

Twitterfon is definitely my favourite Twitter client for the iPhone.  Although I still haven’t tried Tweetie but according to this post there really isn’t much in it.  So I was excited earlier this evening to discover the bookmarklet on the Naan Studio website (hadn’t realised that they also produced the excellent Twitterfox add-in for Firefox as well).

On using the bookmark I noticed whilst it posts shortish URL’s in full for long URL’s it uses the tinyurl.com shortener.  I’ve nothing against tinyurl, in fact many years ago I used to use them extensively when sending bulk email however today there are much better URL shortners to choose from.  So I hacked together a little PHP script to create private cli.gs (N.B. you’ll need to add your cli.gs API key in the place indicated).

<?php
$url = $_GET['url'];
$title = $_GET['title'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, "http://cli.gs/api/v1/cligs/create?
              key=[API key goes here]&appid=BFphpscript&url=".urlencode($url)."&title=".urlencode($title));
$output = curl_exec($ch);
curl_close($ch);
header("location: twitterfon:///post?".$output);
?>

You’d then need to call it in the usual way – i.e. via a bookmark of

javascript:(function(){%20window.open('[location of php script]?url='
+encodeURIComponent(location.href)%20+'&title='+encodeURIComponent(document.title));%20})();

I’m hoping that eventually I’ll figure out a better final line of the php script, i.e. something that can transfer more than just the URL over to Twitter, unfortunately there’s very little documentation for Twitterfon, the only thing I found other than on the Naan website was this piece from someone who had a similar idea of using a php script a couple of weeks ago.

Advertisements

3 Comments »

  1. I originally started out with TwitterFon on my iPhone not long after I got it. I was really impressed with the interface, easy to use and everything pretty much within quick grasp; however I’d noted quite a lot of people using Tweetie, so took the plunge and it became the second app I ever bought.

    I have to say, I do prefer Tweetie over TwitterFon. There’s no immediate functionality that springs to mind that it has over TwitterFon. (Can you manage multiple accounts or theme TwitterFon? I find dark backgrounds easier to read and I have two accounts to manage at the moment). If I were you then I’d make the purchase and get Tweetie. It’s only £1.79 and if you really hate it, you could be cheeky and tell Apple it was an accidental purchase and get your money back! (I am sure there are lots of things it can do that TwitterFon can do anyway – perhaps you wouldn’t use them).

    I also had been using TwitterFox within Firefox but as a reader rather than to post anything. I’ve moved off using it recently, instead opting to use it for new Tweet notifications, but keeping a FF tab with Twitter open all the time instead. I then use two addons to make Twitter appear better. One is Power Twitter (http://bit.ly/8Svt) which changes the default interface with a few neat extras: (from their site)

    -search and recent searches
    -search scoped to a specific user
    -status history peeking on mouseover
    -Facebook status updates
    -inline YouTube, Flickr, TwitPic, Google Maps, song.ly, and more
    -url expansion
    -url translation to page titles
    -open web update (news feed) mapping
    -custom settings
    -@mentions
    -photo uploading
    -link shrinking
    -#hashtags

    The other addon I’ve been using is bit.ly preview (http://bit.ly/p7aq). It provides some neat roll-over functionality. Quote from their site:

    “With the bit.ly Preview Plugin for Firefox, whenever you hover over a bit.ly URL on any web page, we display a tooltip showing the Page Title, Long URL, and any Click Data we have about the page the URL links to. If you hover over another short URL, http://tinyurl.com/5qhkwo, for example, we show the Page Title and Long URL for these links as well. Plus, we check to see if anyone made a bit.ly link pointing to the same place, and, if so, we show how many clicks it has received. All this info should help you decide if a link is worth checking out or not.”

    Anyway, on a personal note. Glad to have found you on Twitter and your blog. I had no idea you were so interested in things like Twitter, FireFox and coding! I’m not much cop at the coding myself, but I do enjoy all these web based technologies and the stuff my iPhone is enabling me to do. I’ve been writing up a few of my own experiences on my blog with regards to troubleshooting issues as I find them.

    Best Wishes!

    Rob

    Comment by Rob — April 30, 2009 @ 2:49 pm

  2. Hiya Robbo,

    Thanks again for hunting me out. Would be good to catch up soon.

    You’re probably right about Tweetie being the best iPhone app for Twitter. TwitterFon certainly doesn’t have custom themes or multiple accounts however when I have run other accounts I’ve used other apps – simply to prevent me tweeting to the wrong account. I’ve also spent the past six months or so using Twitterfon so I guess I’ve just got used to it.

    The same is probably true for cli.gs vs bit.ly. I started exploring cli.gs from a work perspective sometime last year as the tracking/features it provides were a good fit for what I wanted at the time. I have separate cli.gs API keys and accounts for different purposes. My personal (not work) cli.gs account has sort of developed in to a set of private bookmarks in addition to whatever else it provides.

    If I was staying in my current job, one of the things I would have been pushing forward was an own brand URL shortener, as I think it’s one of the things that’s too important to be left to a third-party provider.

    I had a look at PowerTwitter a while ago but from what I’ve tried so far my current preference is Outtwit as a desktop client (http://www.techhit.com/OutTwit/) – I use this in the same way you use Twitterfox – and Splittweet (http://splitweet.com/) / Tweetgrid (http://www.tweetgrid.com/) as web clients.

    Like you, I’m interested in web based technologies, especially where they’ve enabled me to do my day job better, or achieve things I want to do. I’m definitely no coder – I hack (badly)!

    Will hopefully be in touch to catch up with you and the family soon.

    All the best,

    Bren

    Comment by Brendan — April 30, 2009 @ 8:14 pm

  3. Hello!
    I wanted to thank the owner of this blog for making my life so much easier.
    My blog provides all the information ypu need to hack,unlock,activate and jailbreak my iPhone,
    and it will work for an iTouch too. My blog even has the NEW Firmware unlock.
    Which i have not seen anywhere!
    If you are interested in the The iPhone and iTouch Firmware Unlock Blog then do not hesitate and visit.
    You can also Click Here to Visit the Site.

    @@@!!Thank You !!@@@
    Please comie back for new Hacks and Updates !!
    Have a nice day.

    Comment by Jugunfogs — July 12, 2010 @ 1:27 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: