Free "Now Playing" for your Blog
I really have to say, WinAmp is the shiznet… I shouldn’t have been so fickle and just stuck with the longtime champ on all my digital media capable devices… case in point, on my 800MHz Samsung Q1U UMPC running Windows 7, it only eats 4%! CPU when playing in the background.
** Big Tip **: If it blows up on you at line 15 (the wsh.Run line)… fire a representative curl.exe line from your own CMD.exe window and see what happens… for me it was my McAfee silently holding up the show… visibility is a wonderful thing :)
This solution plugs together a couple easy freebies... you can see the results in the "Recently Played" sidebar on my blog (http://beejblog.com/)
- Blogger - the blog platform I'm using because Google rocks
- Twitter - just Google on "Blogger Twitter" to get the "badge" that puts your Twitter feed into your Blogger sidebar
- Media Monkey - a media player with great functionality including Visual Basic scripting support that provides the execution context for this "mashup"
- and finally, the vernerable "Curl" which makes quick work of posting the current song up to Twitter... (Note: make sure "curl.exe" is in your global path or edit the following script to point directly to it.)
Edit in your Twitter {email} & {password} in the following script
and drop the script into "c:\Program Files\MediaMonkey\Scripts\Auto" ...
then restart Media Monkey, play a song & refresh your blog page to see
(as long as you don't get any script errors :)
Speaking of script errors, somehow VBScript wasn't happy on my Windows Server 2008 here... merely had to fire "regsvr32 vbscript" from Start > Run to patch that up.
Script.RegisterEvent(SDB, "OnPlay", "Event_OnPlay")
End Sub
Sub Event_OnPlay()
Dim cur : cur = SDB.Player.CurrentSong
Dim description : description = cur.ArtistName & " - " & cur.Title
If cur.AlbumName <> "" Then description = description & ", Album: " & cur.AlbumName
If cur.Year <> 0 Then description = description & " [" & cur.Year & "]"
Dim commandline : commandline = "curl -u {email}:{password} -d status=""" & description & """ http://twitter.com/statuses/update.xml"
Dim wsh : wsh = CreateObject("WScript.Shell")
Call wsh.Run(commandline, 0, False) '0 = hide dos window, false = don't wait for return
Set wsh = Nothing
Set cur = Nothing
End Sub