Wednesday, 10 December 2008

iTunes RSS Feed Unrecognised Characters (with PHP)

So, I recently wrote a quick PHP script that parses the iTunes store RSS and turns it into some webpages that are easily renderable on a mobile device (see last blog post).

I've written quite a number of RSS parsers in PHP before, it's fairly simple and you just make use of the SimpleXML features built into PHP.

However, this time whenever I opened the feed it returned a whole load of rubbish characters. The feed was read fine in Firefox, Safari etc, but when I opened it with my XML editor (Oxygen) or PHP it was just trash! The root of the problem was in this method:

file_get_contents($rssurl);

(or fopen if that was used instead).

combined with the fact that gzip compression (found by looking at the HTTP headers in Firebug). The solution is to replace either of these methods which can't handle the gzip compression with:

gzopen($rssurl,'r');

and use the gzread method to get the data!


Then you can carry on with the parsing as you wish...

Monday, 8 December 2008

iPhone Applications Directory

I'm currently building a bridge to give a different form of access to the AppStore. This site will basically be a really big directory. I hope to be able to add comments, ratings, etc to it when it's more stable.

For now it is here:

Wickoo - iPhone & iPod Touch Apps / Applications

Monday, 24 November 2008

MGMT - Time to Pretend

This is the latest track which I think is awesome!!! I heard it on some advert on TV, then heard it in a friend's car and hence managed to find out who it is. The synths are amazing! Check it out here:

MGMT - Time To Pretend
icon

Wednesday, 19 November 2008

iPhone Application - Google Adsense

So, it appears that Google Adsense is now being using in iPhone applications to generate revenue. I've just submitted an app which will be using ads supplied from admob.com, however it would be very interested to see how successful the Adsense mobile is. Have a look at this app called AroundMe (it's free to download) at the following link:

AroundMe
icon

Monday, 17 November 2008

Apple Mail HTML Signatures

OK, so apparently you can't have an HTML sig with Apple Mail. This however sucks, cause you need to have links to your stuff in your sig! If you just type the HTML code in, then this code is not rendered and you just end up emailing people code!

What you need to do, is make a HTML page of how you want your sig to be (ensuring that all images etc are online on a server, not on your local machine... only your html can be there). Then open this up in Safari, and save it as a webarchive. Then, copy this archive to ~/Library/Mail/Signatures where you will find all the archives of your sigs.

Goto Apple Mail and make a new sig, call it something useful. Go back to finder and sort the list (which will have names which mean nothing!) by date so that you have the last modified at the top. Don't delete the plist file... you need that! Instead copy the name of the last modified webarchive then move that off to somewhere else on your hard disk. Make the webarchive that you created from Safari to be the name that you just copied. Restart Apple Mail and you should have your lovely HTML file as your sig!

Bingo!

Monday, 10 November 2008

Cheap & Reliable Linux Hosting

I often get asked who I recommend for web hosting. Now, I've never had Windows hosting so I'm afraid I can't answer your question in that case, but for Linux hosting I've always used HostGator. I currently have about 5 sites all running off one of their cheap Linux shared hosting accounts and have no problems with them. I register all my domains with Daily and then simply change the nameservers to point to the hostgator hosting.

Anyways, check out hostgator at the link here:



And Daily here: