Created
August 22, 2009 12:20
-
-
Save coolniikou/172764 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
var ff_u_name = 'username'; | |
var ff_uri = 'http://friendfeed-api.com/v2/search?q=from:'+ff_u_name+'+<$mt:EntryPermalink$>&callback=?'; | |
var list = '<h4>Comments for this entry on FriendFeed</h4>'; | |
var no_title='<h4>No Comments for this entry on FriendFeed</h4>'; | |
list += '<ul class="item_list">'; | |
$.getJSON(ff_uri, function(data){ | |
var en = data.entries; | |
if(!en.length){ $("div.friendfeed_comm").empty().html(no_title); return false; } | |
for (i=0; i<en.length; i++) { | |
var co = en[i].comments; | |
if(!co){ $("div.friendfeed_comm").empty().html(no_title); return false; } | |
for (d=0; d<co.length; d++){ | |
list += '<li class="item_body">'+co[d].body+'</li>'; | |
list += '<li class="item_meta">'+co[d].date+' <span class="meta_name">'+co[d].from.name+'</span></li>'; | |
} | |
$("span.ff_com_count").html('<a href="'+en[i].url+'">ã³ã¡ã³ã on FriendFeed ('+co.length+')</a>'); | |
list += '</ul><p class="leave_txt"><a href="'+en[i].url+'">Leave comment on friendfeed</a></p>'; | |
} | |
$("div.friendfeed_comm").empty().html(list); | |
}); | |
return false; | |
}); | |
//--HTML | |
// display comments count on FriendFeed | |
// <span class="ff_comm_count"></span> | |
// display Comments on FriendFeed | |
// <div class="friendfeed_comm"></div> | |
// | |
//--CSS | |
// | |
//span.ff_comm_count a{ | |
// color: #437EC7; } | |
//div.friendfeed_comm { | |
// background: transparent url('http://friendfeed.com/static/images/widget-logo.png?v=da25') no-repeat scroll right 0; | |
// margin: 5px 0 10px; | |
// border: 1px solid #437EC7; | |
// font-size: 13px; | |
// line-height: 17px; | |
// text-align: left; | |
// overflow: hidden; } | |
// | |
//div.friendfeed_comm h4{ | |
// margin: 30px 0 10px 20px; | |
// color: #437EC7; | |
// font-size: 16px; } | |
// | |
//div.friendfeed_comm ul{ | |
// list-style-image: none; | |
// list-style-position: none; | |
// list-style-type: none; | |
// margin: 0 20px; | |
// padding: 0; } | |
// | |
//div.friendfeed_comm li.item_meta{ | |
// color: #888888; | |
// margin-bottom: 8px; } | |
// | |
//div.friendfeed_comm span.meta_name { | |
// color: #7777CC; }// | |
// | |
// | |
//div.friendfeed_comm p.leave_txt a{ | |
// color: #7777CC; | |
// margin-left: 20px; | |
// font-size:15px; } | |
// | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment