// Requires MooTools DOMReady, Request, and JSON portions
// Requires MooTools More and RequestJSONP portions

window.addEvent('domready', function() {

  var statusDiv = new Element('div', {'id':'microblogging'}).inject('social-networks', 'top');
  statusDiv.set('html', 'Current status:<br /><em><span id="status">Loading current status ...</span></em>');

  // Get current status from Identi.ca/Twitter
  var myDataRequest = new Request.JSONP({
    url: 'https://identi.ca/api/users/show/akorvemaker.json',
    onComplete: function(userData){
      userData.status.text = userData.status.text.clean();
      $('status').set('text', userData.status.text);
    },
    onFailure: function(){
      $('status').set('value', 'error while attempting to retrieve status');
    }
  }).send();
});
