Skip to content

Instantly share code, notes, and snippets.

@kirkegaard
Created February 9, 2010 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirkegaard/299034 to your computer and use it in GitHub Desktop.
Save kirkegaard/299034 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>test</title>
<link rel="stylesheet" href="styles/default.css" type="text/css" media="screen" charset="utf-8"/>
<script src="scripts/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
jQuery(document).ready(function($) {
var feed = 'http://friendfeed-api.com/v2/feed/ranzadk?callback=?';
$.getJSON(feed, function(stream) {
$('<a class="node large yellow">'+stream.description+'</a><br /><br />').appendTo('.lifestream');
$.each(stream.entries, function(i, item) {
var $node = $('<a class="node medium"></a>').appendTo('.lifestream');
switch(item.via.name) {
case 'Digg':
$node.addClass('yellow');
break;
case 'Twitter':
$node.addClass('blue');
break;
case 'Flickr favorites':
case 'Flickr':
$node.addClass('magenta');
break;
case 'Last.fm':
$node.addClass('red');
break;
case 'Vimeo favorites':
case 'Vimeo':
$node.addClass('orange');
break;
case 'Facebook':
$node.addClass('green');
break;
}
$node.append(item.via.name + ': ' + item.body);
$node.attr('href', item.via.url);
});
});
});
</script>
</head>
<body>
<div class="lifestream"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment