Hype machine WordPress Widget (plugin)

November 29th, 2007

Well, here it is. A WordPress plugin for the Hype Machine. A while back I suggested to the HypeM team that they develop a plugin to allow users to list their current ‘loved’ tracks. I have yet to see one (but I’m about as patient as a 5 year old waiting for Christmas), however I have been told they will be working on one shortly.  So i created my own plugin. Personally I will only be using the ‘loved tracks’, but I have included all of the features that their current javascript ‘widgets’ will allow you to do. This hypemachine widget will do the following

  • Display X number of loved tracks
  • Display X number of tracks from your loved feeds
  • Display X number of recent tracks
  • Display X number of popular tracks
  • Display X number of now playing tracks

In a future release you’ll be able to do more like order the above listings, or anything else that HypeMachine users think would be useful. Suggestions welcome.

Download Plugin\Widget

Technorati Tags: , , , , ,

8 Comments so far
Leave a comment

Boat pictures please.

Comment by Brian 11.29.07 @ 9:56 pm

nice work on the plugin. Maybe they will buy it from you for a million dollars. More importantly, http://www.flickr.com/photos/12378089@N00/2075252961/

Comment by rodd 11.30.07 @ 8:48 am

Matthew,

How’s life in the freezing tundra up North, eh? I hope you are doing well. I’d love to hear from you so drop me a line sometime. Take care!

Andy

Comment by Andrew Switala 12.01.07 @ 12:15 am

i second the boat pictures. p.s. 4 comments, 3 comments have nothing to do with the post. so your batting 1 for 4.

Comment by nate 12.03.07 @ 3:17 pm

p.s. – >>> “An error has occured http://HypeM.com/feed/loved/EmmEff/1/feed.xml is probably down. Or the username is incorrect.”

Comment by nate 12.03.07 @ 3:17 pm

Nate, that was a HypeM problem. Not me. Their feeds were down. And yes, apparently everyone feels the need to comment on this regarding other topics. I do have email email people..

Comment by Matt Fiddelke 12.03.07 @ 4:06 pm

tight! works perfectly in WP2.6.

Comment by James Revillini 08.01.08 @ 11:14 pm

If there’s a contact form, I apologize – I didn’t see it. I wanted to send you some code I’ve modded in the hypem plugin, as I was getting SimpleXML errors with the feeds from time to time not being UTF-8 compliant. So I added some more error checking, nice error messages, and a debugging switch to the first function. Here it is (e-mail me if you have any issue with what I’ve submitted):


..
..
..

function widget_HypeM_init() {

$DEBUG = 0; //set to 1 for some debuggin'

// Check for the required API functions
if ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') )
return;

function display_tracks($xmlurl, $linkheading, $numberoftracks) {
$local_rss_file = str_ireplace(' ', '_', $linkheading);

$ch = curl_init($xmlurl);
$fp = fopen($local_rss_file, "w");

curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);

curl_exec($ch);
curl_close($ch);
//echo $fp;
fclose($fp);

if(!$DEBUG && file_exists($local_rss_file))
{
if (!$DEBUG) {
$xml = @simplexml_load_file($local_rss_file);
} else {
$xml = simplexml_load_file($local_rss_file);
}
$link = $xml->channel->link;
$description = $xml->channel->description;
$tracklink = array();
$tracktitle = array();

echo " $linkheading \n";

//Populate TrackInfo array
if (!$DEBUG && !is_array($xml->channel->item)) {
echo __('The feed is too borked for SimpleXML! Turn on debugging in hypemachine.php for more detailed errors.', 'widgets');
} else {

foreach ($xml->channel->item as $item) {
$tracklink[] = $item->link;
$tracktitle[] = $item->title;
}

$trackinfo = array($tracklink, $tracktitle);
for($displaynum=0; $displaynum<$numberoftracks; $displaynum++){
echo("{$trackinfo[1][$displaynum]}");
}
}
}
else
{
echo __('An error has occured '. $xmlurl . ' is probably down. Or the username is incorrect.', 'widgets');
}
}

..
..
..

Comment by James Revillini 08.05.08 @ 9:02 am



Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

(required)

(required)



Humor Blog
Top Sites