So I was very frustrated when all of a sudden my del.icio.us api tag cloud stopped working, since I think it is a super swank piece of kit. I managed today to find out why it stopped working... del.icio.us have a highly secret blog which I (being a total muppet) didn't know about. On this blog they warned everyone their del.icio.us app would break if they didn't wake up and smell the SSL. So today I put together an SSL application for V1 of the del.icio.us https api using PHP and I wanted to share it here in case anyone else ended up having the same issues as me (maybe the friendly natural search monkeys will spider it for you to find).
So calling this API is hyper simple. First you need to define your user name and password:
$dusername = "foo";
$dpassword = "bar";
Then you need to create your URL to call (the example here is for the get tags call which I use in my del.icio.us tag cloud ):
$api = "api.del.icio.us/v1"
$apicall = "https://$dusername:$dpassword@$api/tags/get"
Then you need to throw together your CURL call to the API which I find is needed to connect via CSS and also send the user agent that del.icio.us requires from you
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$apicall);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_USERAGENT, 'alexschultz');
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$xml = curl_exec ($ch);
curl_close ($ch);
Now you should find that your API content is contained in the $xml variable and you can enjoy translating it via the XSL tool of your choice (mine is sablotron because I am a masochist :p )

Moving With Your PC to the US
Moving to the US was a big pain for me in one particular regard... the frequency and voltage of US electricity was not what my computer needed and so I couldn't get my old UK computer working in the US. You can imagine as a web and API geek living without my PC was a painful experience until I bought a new Dell.
I then lived without my computer and in particular my hard drive for 8months but earlier this week a colleague suggested to me that you can get an IDE to USB connector for your old harddrive. I searched for this on eBay and then found one of the Yahoo! adverts on an eBay search results page which I clicked on, found the item I wanted and went back to eBay (finding the item cheaper on the site even including postage). I finally got the connection today which was an ion external harddrive casing and IDE to USB 2.0 connection.
It is up and running and quietly humming away on my desk... I now have my university music collection (2000 songs) and all my university photos again which has made me a very very happy boy this evening! So if you move countries and find your computer isn't working (even with a power adapter) don't fear, you can always recover the harddrive content using a IDE to USB 2.0 external hardrive connection (potentially from ion).
August 22, 2006 in general comments | Permalink | Comments (0)