$(function(){$.get("/Location",function(c){var a=c.split("|"),b=new Microsoft.Maps.Location(a[0],a[1]);map=new Microsoft.Maps.Map(document.getElementById("map"),{credentials:"AtS9ziOTJVeYxtUAB0WI1G0dRiFXH5hdREsFoIRbGRlW6gkGjvk-9UFKIPYP3ie-",center:b,zoom:18,mapTypeId:Microsoft.Maps.MapTypeId.birdseye,showDashboard:false,showScalebar:false,enableClickableLogo:false,enableSearchLogo:false,disableZooming:true,disablePanning:true});map.entities.clear();var d=new Microsoft.Maps.Pushpin(b);map.entities.push(d)})});$(function(){var a=document.createElement("script");a.setAttribute("src","https://api.twitter.com/1/statuses/user_timeline.json?screen_name=davepermen&count=40&callback=twitterCallback");document.body.appendChild(a)});function twitterCallback(d){for(var e=5,b=[],c=[],g="",a=0;a<e;a++){var i=d[a].user.screen_name,f=d[a].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g,function(a){if(a.indexOf("youtu.be")>-1){a="http://www.youtube.com/v/"+a.substr(a.lastIndexOf("/")+1);return'<p><object class="flashvideo" type="application/x-shockwave-flash" data="'+a+'"><param name="movie" value="'+a+'" /></object></p>'}return'<a href="'+a+'">'+a+"</a>"}).replace(/\B@([_a-z0-9]+)/ig,function(a){return a.charAt(0)+'<a href="http://twitter.com/'+a.substring(1)+'">'+a.substring(1)+"</a>"});if(f[0]=="@"||f[f.length-1]=="#"){e=e+1;continue}var h=date(d[a].created_at);if(h!=g){if(c.length>0||a>=e){b.push(c.join("</article><article>")+"</article>");c=[]}b.push('<article><time datetime="'+d[a].created_at+'" pubdate>'+date(d[a].created_at)+"</time>")}g=h;c.unshift(f)}if(c.length==0)b.pop();else b.push("<what>"+c.join("<what>")+"</what>");b.push('<h1>More</h1><article>for more news from davepermen, check <a href="https://twitter.com/davepermen">my twitter feed</a> for the full history</article>');$("#twitter_update_list").after("<article id='twitter_update_list_new' />");$("#twitter_update_list_new").hide();$("#twitter_update_list").attr("id","twitter_update_list_old");$("#twitter_update_list_new").html(b.join(""));$("#twitter_update_list_old").fadeOut(function(){$("#twitter_update_list_old").remove();$("#twitter_update_list_new").fadeIn();$("#twitter_update_list_new").attr("id","twitter_update_list")})}function date(b){var a=b.split(" ");return formatday(a[2])+" of "+formatmonth(a[1])+" "+a[5]}function formatday(a){while(a.substr(0,1)=="0"&&a.length>1)a=a.substr(1,9999);return a=="1"?"1st":a=="2"?"2nd":a=="3"?"3rd":a+"th"}function formatmonth(a){switch(a){case"Jan":return"January";case"Feb":return"February";case"Mar":return"March";case"Apr":return"April";case"May":return"May";case"Jun":return"June";case"Jul":return"July";case"Aug":return"August";case"Sep":return"September";case"Oct":return"October";case"Nov":return"November";case"Dec":return"December";default:return a}}
