﻿google.load('jquery', '1.3.2');
google.load('feeds', '1');
var q_init;
jQuery(function ($) {
    // Grab recent tweets and stick 'em in the ...
    var url = "http://twitter.com/statuses/user_timeline/307575465.rss";
    new google.feeds.Feed(url).load(function (result) {
        var html = '';
        if (!result.error) $.each(result.feed.entries, function () {
            html = html + '<li>' +
				this.content.replace(/^(.*: )/, '').
				replace(/((?:https?:\/\/)(?:[^\s]*))/i, '<a href="$1">$1</a>').
				replace(/@([A-Za-z0-9_]*)/, '@<a class="handle" href="http://twitter.com/$1">$1</a>') +
				' <a class="time" href="' + this.link + '">' + new Date(this.publishedDate).format('h:MM TT mmm dS') + '</a></li>';
        });
        $('#tweets').append('<ul>' + html + '</ul>');
    });
    // ...'cause geeks are good for some things! :)

    //var host = 'img/features/';
    //var images = [host+'sprouts.jpg', host+'garage.jpg', host+'thrusters.jpg', host+'sprout.jpg'];
    //$('<img/>').attr('src', images[Math.random()*images.length|0]).appendTo('#feature-image'); 

})
