javascript:(function(){var g=false;var f={"arstechnica.com":"Ars Technica","bloomberg.com":"Businessweek","bostonglobe.com":"The Boston Globe","econlog.econlib.org":"EconLog","economist.com":"The Economist","en.wikipedia.org":"English Wikipedia","ft.com":"Financial Times","givewell.org":"GiveWell","huffingtonpost.ca":"Huffington Post Canada","huffingtonpost.com":"The Huffington Post","independent.co.uk":"The Independent","indiatimes.com":"The Times of India","intelligence.org":"Machine Intelligence Research Institute","latimes.com":"Los Angeles Times","lesswrong.com":"LessWrong","mirror.co.uk":"Mirror","nybooks.com":"The New York Review of Books","nytimes.com":"The New York Times","plos.org":"PLOS","press.princeton.edu":"Princeton University Press","princeton.edu":"Princeton University","quora.com":"Quora","rationality.org":"Center for Applied Rationality","telegraph.co.uk":"The Telegraph","theatlantic.com":"The Atlantic","theguardian.com":"The Guardian","theregister.co.uk":"The Register","usatoday.com":"USA Today","usnews.com":"U.S. News & World Report","washingtonpost.com":"The Washington Post","who.int":"World Health Organization","wikipedia.org":"Wikipedia","wired.com":"WIRED","wsj.com":"The Wall Street Journal"};function d(o){var m=Date.parse(o);if(m){var n=new Date(m);var l=["January","February","March","April","May","June","July","August","September","October","November","December"];return l[n.getUTCMonth()]+" "+n.getUTCDate()+", "+n.getUTCFullYear()}else{return 0}}function j(m,n){var l=(m-n)/(1000*60*60*24);if(l>2){return false}else{return true}}function c(){var r=document.getElementsByTagName("meta");var y={url:document.URL};for(var q=0;q0&&!("author" in y)){y.author=z[0].textContent.trim()}var l=document.getElementsByClassName("date");if(l.length>0&&!("date" in y)){y.date=l[0].textContent.trim()}}var v=d(y.date);if(v){y.date=v}if(window.getSelection()!=""){y.quote=window.getSelection().toString()}if(location.hostname in f){var p=f[location.hostname]}else{if(location.hostname.split(".").slice(1).join(".") in f){var p=f[location.hostname.split(".").slice(1).join(".")]}}if(p){y.publisher=p}if(location.hostname=="www.lesswrong.com"){try{y.date=d(document.getElementsByClassName("posts-page-content-body-metadata-date").item(0).innerText)}catch(o){}try{y.author=document.getElementsByClassName("posts-page-content-header-author").item(0).innerText}catch(o){}}if(location.hostname=="www.greaterwrong.com"){try{y.date=d(document.getElementsByClassName("post-meta")[0].getElementsByClassName("date")[0].innerText)}catch(o){}try{y.author=document.getElementsByClassName("post-meta")[0].getElementsByClassName("author")[0].text}catch(o){}y.title=y.title.replace(/ - LessWrong 2 viewer/,"")}var u=false;if(document.URL.match(/\/\/archive\.is\//)){u=true;y.archiveurl=y.url;if("date" in y){y.archivedate=y.date}y.url=document.querySelectorAll("input")[0].value;delete y.date;delete y.publisher}else{if(document.URL.match(/\/\/web\.archive\.org\/web\//)){u=true;y.archiveurl=y.url;y.url=encodeURI(document.querySelectorAll("input#wmtbURL")[0].value);var s=document.URL.match(/\/\/web\.archive\.org\/web\/\d{8}/)[0].substr(-8);y.archivedate=d(s.substr(0,4)+"-"+s.substr(4,2)+"-"+s.substr(6,2))}}if(u){var w=Date.parse(y.archivedate);if(w){var t=new Date(w);if(!j(x,t)){y["dead-url"]="yes"}}if(!("dead-url" in y)){y["dead-url"]="no"}}return y}function e(n){var l="The following metadata were detected:\n\n";for(var m in n){if(typeof(n[m])==="string"){l+=m+" = "+n[m]+"\n"}}l+="\nYou can copy this reference:";return l}var a=false;function i(m){for(var l in m){var p=m[l];if(typeof(p)==="string"){p=p.replace(/[“”]/g,'"');p=p.replace(/[‘’]/g,"'");p=p.replace(/--/g,"–");p=p.replace(/\n/g," ");p=p.replace(/\|/g,"{{!}}");m[l]=p}}var o=m.publisher;if(o&&(location.hostname in f||location.hostname.split(".").slice(1).join(".") in f)){if(a){m.publisher="[["+o+"]]"}else{m.publisher="[[wikipedia:"+o+"|"+o+"]]"}}var n="{{cite web";for(var l in m){if(typeof(m[l])==="string"){n+=" |"+l+"="+m[l]}}n+="}}";return n}function b(){var l=c();return[e(l),i(l)]}var h=b();var k=prompt(h[0],h[1])})();