/** * Elgg identi.ca widget * This plugin allows users to pull in their identi.ca feed to display on their profile * * @package ElggIdentica */ elgg.identica = {}; /** * Parse the JSON result for show this in HTML * * @param JSON string the JSON result of the identi.ca's call */ elgg.identica.callback = function(identicas) { var statusHTML = []; for (var i=0; i]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) { return ''+url+''; }).replace(/\B@([_a-z0-9]+)/ig, function(reply) { return reply.charAt(0)+''+reply.substring(1)+''; }).replace(/\B#([-_a-z0-9]+)/ig, function(tag) { return tag.charAt(0)+''+tag.substring(1)+''; }).replace(/\B!([_a-z0-9]+)/ig, function(group) { return group.charAt(0)+''+group.substring(1)+''; }); statusHTML.push('
  • '+status+' '+elgg.get_friendly_time(identicas[i].created_at)+'
  • '); } document.getElementById('identica_update_list').innerHTML = statusHTML.join(''); } elgg.identica.init = function() { username = $('#identica_update_list').data('username'); num = $('#identica_update_list').data('num'); js = "https://identi.ca/api/statuses/user_timeline/"+username+".json?callback=elgg.identica.callback&count="+num; $.getScript(js); }; elgg.register_hook_handler('init', 'system', elgg.identica.init);