num=10;C=Components;d=C.classes['@mozilla.org/browser/nav-history-service;1'].getService(C.interfaces.nsPIPlacesDatabase).DBConnection;q=d.createStatement("SELECT url FROM moz_places WHERE url LIKE 'http://__.wikipedia.org/wiki%'");ignore=/^(Special|Talk):/;seen={};w=[];while(q.step()) {u=q.row.url;n=unescape(u);x=n.indexOf('#'); if(x==-1)x=n.length; n=n.substring(29,x).replace(/_/g,' '); if(!ignore.test(n) && !(n in seen)) { w.push({url:q.row.url, name:n});seen[n]=true}} h="10 random Wikipedia URLs out of "+w.length+"...
    \n"; while(num--) { r=Math.floor(Math.random()*(w.length+1)); h+="
  1. "+w[r].name+"\n";}h+="
"; open('data:text/html,'+escape(h))