Malleable Musings

April 25, 2009

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

Filed under: PHP, cli.gs, iphone, 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.

March 25, 2009

Php files and the iphone

Filed under: PHP, iphone, simple hacks — Brendan @ 7:07 am

I’m beginning to think that php files offer an unrivalled way of doing things quickly with the iPhone.

Simply save the file and add the link to the file as a bookmark in Safari.

My most recent effort is a quickly hacked together page which updates my location on Twitter. I simply call the page and my location is updated, a process that otherwise I find quite convoluted (it’s the one missing feature from Twitterfon, although Twitterfon does allow lat/long coordinate updates).

Generally I am in one of three places, at home in Cov, in London at work or in between on the train. So I have four php files (all based on twitter.lib.php file from php classes) bookmarked in Safari, one for each of the three common locations and one for if I am elsewhere (this script has a text input box rather than the location value hard coded).

January 6, 2009

Go ask Apple

Filed under: Emails, iphone — Brendan @ 9:21 pm

I felt that I had to blog about my very interesting experience earlier today / yesterday with Constant Contact.

I’ve signed up for a guest account with them and was going to run a test campaign this evening through them. If it had been successful I could well have been pushing our email marketing out to them.

Constant Contact has got a nice simple interface with a WYSIWYG editor and an API that seems to do what I want and to cap it off we’ve just appointed a new member of staff (started on Monday) who is likely going to be writing a lot of the email who is used to using Constant Contact.

Screen shot of a Constant Contact Template on iPhone

Screen shot of a Constant Contact Template on iPhone

However doing some testing I noticed something that I didn’t like in their footer. Look what happens when you send a message to someone using a free webmail service (e.g. yahoo or gmail) on an iPhone.

Why does it do this? Well at first I thought it was entirely to do with the code used to insert the Constant Contact branding images, which is in a footer that I can’t edit.  I noticed that there are no width attributes on the img tags. Without the width attributes the alt text will expand to fill whatever space is available, ie. in this case the entire width of the iPhone screen causing disruption to the top of the template.  However on closer inspection I don’t think it is this but I’m not enough of a coding guru and don’t have the patience to work through the nested tables and div tags to find out what is actually going on.

Anyway I used their live chat facility to ask a few questions. The full transcript is saved on their support section. I could paste it here but I don’t think it would add anything. Whilst I was having a live chat a sales person from Constant Contact rang me. Now I don’t know about you but if I’ve got the option of voice or IM contact I’ll opt for voice nine times out of ten so I excused myself from the Live Chat (the sales person apparently didn’t know I was chatting online) to concentrate on the phone call.

Side note: Live chat is great from an organisational point of view (good blog post highlighting benefits) but it doesn’t satisfy me as a customer – but that’s probably for another blog post?

The gist of both chats (online and voice) was that I could probably get the footer changed for $100 if I upgraded to a paid for account. But usually the turn around time for a custom footer is 2-3 business day. The sales lady I talked to passed me through to one of their “senior” technical people to see if he could do anything.

So I explained the situation – explained how we do a lot of work out in emerging markets in which mobile is important and how our %ges of mobile users within our site visitors are at least double or triple stats like this and how they are growing fast.  I also explained that I expected email to be even more likely to be accessed via mobile phone technology than web browsing. I then offered to send through a screenshot to explain the situation, which I did straight away.

I got an autoreply with the following (very helpful?) links:

Adding an image to an email
How does Outlook 2003 impact your campaigns?
Match graphic dimensions to template layout
Classic Wizard: Inserting extra images
Adding stock images to an email

and then an hour or so later I got the following email.

Dear Brendan,

I see that you already spoke with our of our representatives regarding this issue. I would like to inform you that most handheld devices (PDA) and iPhone have webbrowsers that aren’t fully compatible with HTML emails. This may result in your emails to not appear properly. When we create our templates we try to make them appear properly across most widely used web browsers (targeted to PC’s and MAC). However since the issue is relate to the compatibility with the browser/client in iPhones you must report the matter to Apple support directly. In the meantime I will also forward your email to my engineers to see what can be done to make all our HTML emails compatible with iPhones.

I’m very sorry this was not exactly the information you were hoping to hear; but if I can be of further assistance, then please don’t hesitate to reply to this email.

Thanks for using Constant Contact!

Regards,
Abhijit
Constant Contact Customer Care

For me reading this email was one of those wake up and smell the coffee moments…

1. It made me think a lot about the steps we’re taking in customer service and whether we have enough mechanisms in place to really help a customer.
2. It reminded me how I want to be working with organisations that are looking to the future and are easy to deal with (N.B. despite how this post may come across I think that Constant Contact may still fit this criteria).
3. It reminded me how much testing is actually needed on things like this. My guess it’s not just the iPhone that’s impacted it might well be anything that displays less than the default 600 pixel width templates that Constant Contact are currently using.
4. It also reminded me how easy it is sometimes to phrase things badly…. e.g. it’s not that the templates aren’t compatible, with the way I think an increasing number of people will be accessing their emails, it’s that:

most handheld devices (PDA) and iPhone have webbrowsers that aren’t fully compatible with HTML emails

So what’s next – well I don’t know. I haven’t got any emails planned for a while but maybe next time I’ll give myself enough time to tinker with their CSS or I might pay $100 to get a custom template designed (if I remember that is).

December 28, 2008

Cligs and the iPhone – Part II

Filed under: cli.gs, iphone — Tags: — Brendan @ 8:42 pm

I posted previously about a better alternative to Twitterlink on the iPhone. A javascript function that calls cli.gs directly. (Cli.gs is a URL shortening service with analytics – great for measuring impact on a newsfeed from Twitter or elsewhere.)

Thanks to Pierre at cli.gs, I’ve now improved this by creating several javascript functions as bookmarks that call a PHP script, passing specific variables. e.g. this function passes an action that I’m “Reading about ” the “document title” and the “URL” to the script which calls the cli.gs API and returns the results as a parameter to the Twitter homepage (checking that it meets Twitter’s character limit).

N.B. I decided this was preferable rather than posting directly to Twitter as it allows a review before posting, however I might change this in the future.


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

I’ve already completed the same bookmark for “Commenting on ” and making a “New post “. I’ll see what other actions I will find useful over the next few days.

If you are interested in implementing something like this for yourself. You’ll need a bit of webspace where you can run PHP.

The PHP script is simple enough (and most of it is courtesy of Thor Erik’s rater than me) however I’m sure it can probably be improved and suggestions will be gratefully recieved.

If you do want to use this you’ll need to alter [my api key] to your own cli.gs API key and then upload the script.  Then all you need to do is change [location of php script] in the Javascript calls and work out what actions you want (remember to use %20 instead of spaces) when you’re setting your bookmarks.


<?php
$act = $_GET['act'];
$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=[my api key]&appid=BFphpscript&url=".urlencode($url)."&title=".urlencode($title));
$output = curl_exec($ch);
curl_close($ch);
if (strlen($title) < (137 - strlen($act) - strlen($output))) {
$status = $act . $title . "%20-%20" . $output;
}
else {
$status = $act . substr($title, 0, (137 - strlen($act) - strlen($output))) . "%20-%20" . $output;
}
echo $status;
header("location: http://twitter.com/home?status=".$status);
?>

December 22, 2008

Cli.gs and the iPhone

Filed under: cli.gs, iphone — Brendan @ 11:25 pm

I’ve been flirting with Twitter recently and exploring various different clients on my iPhone including Twitteriffic, TwitterFon, Twinkle and Twitterlink which are all available through the AppStore.

I’m currently running several Twitter accounts, one of which is a pure newsfeed which is usually managed through Twitterfeed.  This is pushing various RSS feeds out for me, however not all link back to a site on which I’m running Analytics.

The default URL shortening service in Twitterfeed is TinyURL.  However today I changed this to Cli.gs which for me has several advantages:

  1. a shorter character count
  2. tracking (including hits over time, geo-location of hits, referrer counting, and social media counts)
  3. it works brilliantly with the iPhone as it’s a javascript call.

In a sense it replaces Twitterlink entirely for me and it has the advantage of pushing a shortened trackable URL.

To install on the iPhone it’s the usual trick of bookmarking a URL e.g. http://malleablemusings.wordpress.com/2008/12/22/?javascript:(function(){ window.open(‘http://cli.gs/cligs/new?url=’+encodeURIComponent(location.href)+’&amp;title=’+encodeURIComponent(document.title)); })();

and then going in to edit your bookmark by deleting everything before the word javascript.

Brilliant!

December 4, 2008

Xmas greetings

Filed under: Emails, iphone — Brendan @ 8:52 am

I thought I’d just make a short post about a Xmas greetings I got from Purdue yesterday.  I’ve been on their mailing list  since I signed up at a Linden tours fair, in Singapore, a few years ago.

This is how it displayed on my iPhone which is how I’ve been accessing my emails this week.

The top screen grab is the email I received.  The bottom screen grab is the web page that the email directed me to. It’s great on a flash enabled machine – see for yourself.

I think it just goes to show the importance of cross platform testing especially as more and more people start accessing the web using handheld technology.  I guess it also shows the importance of updating and checking your database.

November 30, 2008

My current iPhone apps

Filed under: iphone — Tags: — Brendan @ 6:56 pm

The word really drawn on the screen of WritingPadI’m a recent iPhone convert and at the moment I am still trying to figure out what apps I should have on it.  If anyone has any suggestions please let me know.

At the moment my preferred data entry tool is WritingPad on which you make patterns on the keyboard in order to enter text. I seem to find it quicker than typing with two thumbs.  I’m then currently emailing these notes to myself but I guess that eventually I ought to write a script / or look at plugins to update blog entries by email.

I have to admit I hadn’t considered how important copy and paste is. I still can’t believe the iPhone doesn’t support this.  Yes there is i-Copy but it is severely limited in terms of what it can do.

The two applications that have made me go wow so far are Twinkle and the iPint (although the later simply because its a great piece of branding and WOM for Carling).

I suppose Twinkle is no different from many other Twitter tools (e.g. Twitterlocal and Twittervision) but there are still a few things I like about it. The first is the idea of tweeting and seeing responses within the your localized area. The other is just watching the world map and seeing what Twinklers around the world are doing and the feeling of connectedness that this gives (I’m reminded of a sentence in James Lovelock’s the Gaia Theory about interesting things happening when 10 billion things start making connections).

I am still exploring other apps but I thought that it was worth mentioning the HE related ones I’ve found so far. The iStanford app is definitely worth a look either through this blog post, or get on to iTunes (and also read Nick’s review – it’s great to see a university on the cutting edge).

The other HE related ones were the Ball State University Chirper (designed for sports fans) and a Princeton travel timetable.

The other apps I’ve installed and used are MyRailLite, Facebook and WordPress, however I’m guessing my apps will change a bit over the next few weeks as I explore some more.   However I am fairly sure that I’ll be sticking with the iPhone operating system for the moment rather than playing about with Linux.

November 29, 2008

Day off work

Filed under: Life at home, iphone — Tags: , — Brendan @ 7:56 am

Had a day off yesterday and spent it redecorating the guest bedroom. Why the previous owners of my house painted their ceilings with elastic paint (see photo below) I have no idea!

Also spent a bit of time playing with the iPhone – downloaded a few apps (including the word press one – this is my first iphone post), set up a twitter and twinkle account and started following a few UK universities to see how they are using these tools first hand – have read a lot of blog posts but still wanted to see for myself.

Blog at WordPress.com.