Source

MooFFDebate / src / index.html

Full commit
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>MooFFDebate</title>

    <script type="text/javascript" src="http://static.tumblr.com/j8ivo9f/L27l0td25/moocore.js"></script>
    <script type="text/javascript" src="http://static.tumblr.com/j8ivo9f/ljBl0td33/moomore.js"></script>
    <script type="text/javascript" src="mooffdebate.js"></script>
    <script type="text/javascript">
        if (window.console === undefined){
            var console = {};
            console.dir = console.log = function(){};
        }
        window.addEvent('DOMContentLoaded', function(){

            var processFriendFeed = function(data){
                var comments = [];
                var comments_container = $('frf-comments');
                $each(data[0].comments, function(comment){
                    comments.push([
                    '<div class="comment">',
                        '<div class="comment-author">',
                            '<a href="http://friendfeed.com/', comment.from.id, '">', comment.from.name, '</a>',
                        '</div>',
                        '<div class="comment-body">', comment.body ,'</div>',
                    '</div>'
                    ].join(''));
                });
                comments.push('<a href="http://friendfeed/'+ data[0].id +'/">Comment with FriendFeed</a>');
                comments_container.set('html', comments.join(''));
            };

            var processTwitter = function(data){
                var tweets = [];
                var tweets_container = $('tw-mentions');
                $each(data.tweets, function(tweet){
                    tweets.push([
                        '<div class="tweet">',
                        '<a href="http://twitter.com/"', 
                            tweet.tweet_from_user, '/status/', tweet.tweet_id, '/">',
                            '@', tweet.tweet_from_user,
                        '</a>', ' : ', tweet.tweet_text,
                        '</div>'
                    ].join(''));
                });
                tweets_container.set('html', tweets.join(''));
            };

            var comments = new Comments({
                url: 'http://weirdfledgling.tumblr.com/post/525827818',
                services: [
                    FriendFeed,
                    Twitter,
                ]
            });

            comments.addEvent('complete', function(data, service_name){
                switch(service_name){
                    case 'FriendFeed': processFriendFeed(data); break;
                    case 'Twitter': processTwitter(data); break;
                }
            });
            comments.fetch();
        });
    </script>
</head>
<body>
    <h1>Mentions in Twitter</h1>
    <div id="tw-mentions"></div>
    <h1>Comments in FriendFeed</h1>
    <div id="frf-comments"></div>
</body>
</html>