jump to navigation

Tech: How to create Yahoo Widgets December 18, 2009

Posted by truthspew in Uncategorized.
trackback

If you want to make your own Yahoo Widgets just go here and download the SDK, the Konfabulator Reference Manual, and the tutorial and you’re off and running.

You might also download the Widget Class Library. It’s very simple, all you need is a decent text editor. I can recommend Notepad++

(Takes you right to the download page, you want Binary Files and you can choose from a self-extracting EXE file or a ZIP file.

Here’s what I did with their Hello World test. This one just puts the current artist, track title and total time on the desktop in a nice blue 18 point text. No bells, whistles, etc. hence the name iTunesSimple:

<?xml version="1.0" encoding="UTF-8"?>

<widget>
	<debug>off</debug>

	<window>
		<name>main_windows</name>
		<title>iTunesSimple</title>
		<height>100</height>
		<width>1280</width>
		<visible>true</visible>

		<text>
			<name>myText</name>
			<color>#302DFF</color>
			<size>18</size>
			<alignment>left</alignment>
			<vOffset>25</vOffset>
			<hOffset>2</hOffset>
		</text>
	</window>

	<timer>
		<name>timer</name>
		<interval>1</interval>
		<ticking>true</ticking>
		<onTimerFired>
			var trkTitle = iTunes.trackTitle;
			var trkArtist = iTunes.trackArtist;
			var trkLngth = iTunes.trackLength;

				myText.data = trkTitle + " by " + trkArtist + " " + trkLngth;


			myText.opacity = 255;
		</onTimerFired>
	</timer>
</widget>

It’s an odd mix of XML definitions and JavaScript code. And did I mention I’m sort of hating the string functionality of JavaScript, yes it has substring but I am so familiar with the right, left and mid statements in other languages. Grrrr.

Advertisements

Comments»

1. wondermann - December 19, 2009

interesting to know


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: