Let’s geek out a little. Liz was asking about social networking aggregators (she was, I swear), and I bet there are a bunch, but FriendFeed is the big one right now. As soon as I checked it out and set up my feed, I noticed that while there are a few of the online music services listed, there wasn’t a way to publish what I was listening to on my iTunes. However, since I already have Brandon Fuller’s awexxxome Now Playing iTunes Plugin installed, and that publishes to my own blog, I figured there had to be a way to hook Now Playing to FriendFeed. Sure enough, there is a “Ping” function built in to Now Playing that sends an HTTP POST to a given URL with the the now playing info. A quick download of the FriendFeed php API, and now a few lines of php bridge the gap and publish what’s playing on my PC to FriendFeed. Incredibly, it turns out that the FriendFeed API uses the same fieldnames that arrive in the Now Playing POST. That never happens.
require_once("~/lib/friendfeed-api/php/friendfeed.php");
define( 'FF_NICKNAME', 'XXXXXXXXX' );
define( 'FF_REMOTE_KEY', 'XXXXXXXXXXXX' );
if ($_POST['title']) {
$friendfeed = new FriendFeed( FF_NICKNAME, FF_REMOTE_KEY );
$entry = $friendfeed->publish_link( 'Now Playing: '.$_POST['title'], $_POST['link'] );
}


