I recently found this: http://www.quietconfusion.com/2003/07/blogtunes/
I’m trying to figure out how to implement this into WordPress. I’ve seen an Amazon plugin for WP, so this shouldn’t be that difficult. I’m going to try and work on it and maybe if anyone else finds it to be an interesting project, they can post their results here.
Let me know if you need any help. It’d be fairly easy to have a script for CG-Amazon which is the thing pinged with the iTunes update information, locates the right Amazon product, and flags it in the database. Then the pageload code could display the flagged entry(ies).
Any help would be appreciated. I’ve got this: [http://wiki.wordpress.org/Display%20current%20iTunes%20Track%20info] running on my site. I installed the Kung Tunes software and have it running in the background, so my iTunes tells Kung Tunes what’s playing and then it drops that information on my site. You can see what it’s doing here: http://www.playswellwithothers.net, right side, near the bottom.
So what I’d like it to have a link to iTunes and Amazon so people have the option of downloading or buying the song… and if I can have my Amazon ID in there that’s even coolor. At this point, I’ve got my wishlist and need to figure out how to make it happen. So, any help would be greatly appreciated.
Yeah, this can be done, likely using something close to what he was doing with MT.
The problem I encountered was trying to do an Amazon search with the current (remix) title you had on your site. I had to strip out the parenthesized part, and nuke the ampersand, and THEN amazon fed me the right album. Well, or at the least, the remix-single album ISN’T up there… 😉
I can definitely see ways to feed this to CG-Amazon, but I’m trying to come up with a way to encode the search term so that I can cache the result and not continuously re-search for it…
By the way, CG-Amazon can already show items from your wishlist just fine (or any other items), let you show selected items from a custom database you build up (‘what I’m reading’), and can be set up with your amazon assoc ID.
I’ve posted this in the cg-amazon thread, but I’ve installed it in my 1.2 install and it’s giving me an error when I try to add an item.
As soon as I enter an ASIN and hit the add button, I get this message:
Fatal error: Call to undefined function: stream_set_timeout() in /Users/gbarber/Sites/pwwo/wp/cg-plugins/XMLParser.php on line 61
Yeah… I apparently have a host (and local) PHP version that supports a lot of newer stuff.
Try changing that line to:
if (function_exists('stream_set_timeout')) stream_set_timeout($fp, 7); // 7 sec timeout...
For the moment, that’ll fix it.
I’ll go update cg-feedread and cg-amazon with the correct longer workaround…
Thanks for the heads-up,
Awesome David… works like a charm. It’s a bit of learning curve coming from MT to WP, but so far I’m liking WP much better. They had me at “you don’t have to rebuild every time”.
And “you had me at ‘Awesome'”. 😉
Looks nicely integrated.
Hey, you gonna start using it at digink too? 😉 The wishlist function is nice…
Lemme know if you find any missing features!
Back to the now-playing thing, Recent Tunes also looks promising. I’ll look at it as well, as better to have one backend solution that supports multiple client interfaces (it’ll be a script that can be passed one or more artist/song/album combos, and store it for retrieval by the ‘plugin’ part).
Just found a ‘tracking’ applet for Windows iTunes:
I have a much-modified script, that should work with anything that can do a URL post.
And I have rudimentary album lookup working. I just have to figure out how to properly clean up the results, and cache the whole thing so it only looks up again on significant changes.
Okay, making decent progress. I have ‘CG-WhatTunes’, that can pull data from my new tracktunes.php script (an offshoot of some sample code from Recent Tunes), and manage CG-Amazon lookup calls and displaying the results.
Getting the song name displayed is a bit hard, due to the nature of how CG-Amazon works. I may write a completely custom lookup, but trying to extend the CG-Amazon system to do things, well, ‘better’. It was actually easy one I realized that I had to change all the spaces in the ‘keyword’ string to %20’s all over the place. (Don’t know if there’s an encoding function I’ve yet to find in PHP…).
I might have it together in the next day or two. It’ll require a newer version of CG-Amazon as well, which might be the new Plugin-ready version.
If you want the iTMS link as well, that’s going to be later on… 😉
Wow. Thanks for putting so much work into what I thought would be an easy little script. I can’t wait to see what you come up with.
It’s almost ready. Need to make a plugin stub, test it in 1.2, and finish my cleanup (and plugin stubbing) for CG-Amazon and CG-Referer, AND finish testing my major overhaul to a custom-coded URL/HTTP retriever (so I can actually set timeouts so amazon doesn’t hang a page for too long…).
Spent the entire day writing the new HTTP code: who knew that XML feeds come in so many different forms, that HTTP has about 4 different ways it can be packaged (not including compression!), and that WordPress actually generates ‘bad RSS2 HTTP’ encoding by my ‘strict’ interpretation of the spec. So I had to ‘loosen’ my code so that all the WP feeds will still work… 😉 AND deal with Redirects! Oh joy.
hi all. Quick update. I’ve spent the last few days now COMPLETELY changing all of my core code over to plugins, and holding off on a release of CG-WhatTunes until everything is stable (since it depends on CG-Amazon, which depends on XMLParser…etc.).
Anyone looking to be an early guinea pig? 😉 It’ll require at least CG-Amazon and CG-WhatTunes plugins (CG-Amazon is the real beast…).
The current version (fluctuating as we speak) uses a keyword search based on a stripped down artist-name + album-name string. It caches it, so you’ll only get the amazon lookup hit once in a (default) 24h period per-album. Pretty nice. Next is going to be looking up to see if the album is IN your CG-Amazon database already, and if so pull out any annotations from the database (WHEEEEE!).
- The topic ‘iTunes/Amazon Now Playing List…’ is closed to new replies.