Friday, February 6, 2009

Blogspot widgets as a file?

I've spent the last hour or so trying to get my head around widgets so I could add my DeviantArt favourites.  

The things that has had me stumped is that when you add a widget (or gadget) to BlogSpot, one of the options is to add your own by specifying a URL to it.  So this is what I wanted to do--create a widget file generated using PHP and add it to this site.

The things is, the process of creating a widget file isn't really documented and I couldn't create a file that the Add Gadget process would accept.  I tried XML, HTML, JavaScript and plain text.  Very frustrating.

So instead I've manually added widget code with a JavaScript include, in the Blogspot template, that is generated using PHP… yeah getting the images from DeviantArt to here goes through a lot of loops.

If anyone knows the correct way to format a widget in its own file, please leave a comment.  A simple "Hello world" example is all I need.


Luckey said...

hey i was wondering if you ever figured out how to get DA Faves on your site. I really wanna do this with my site. thanks.

microUgly said...

I did, yes. You didn't notice them on the right? :)

I've kinda done it the long way. I created a PHP file which I host on my own server which reads the DA RSS feed. The PHP then generates Javascript code. I then include the JS/PHP file using script tags on this blog. Ideally I would just use JS to read the RSS, but my JS skills are weak.

Post a Comment