Bookmarklet

From Boxtheweb

(Difference between revisions)
 
(3 intermediate revisions not shown)
Line 1: Line 1:
The bookmarklet is still experimental at this point.  To use it drag one of the following links to your bookmarks bar or add to your favourites:
The bookmarklet is still experimental at this point.  To use it drag one of the following links to your bookmarks bar or add to your favourites:
-
javascript:(function(){var%20tags%20=%20document.getElementsByTagName(%27channel%27);%20if(tags.length%20%3E%200)%20{var%20tag%20=%20document.createElement(%27link%27);tag.href=window.location;tag.rel=%27alternate%27;tags[0].appendChild(tag);}%20tags%20=%20document.getElementsByTagName(%27feed%27);%20if(tags.length%20%3E%200)%20{var%20tag%20=%20document.createElement(%27link%27);tag.href=window.location;tag.rel=%27alternate%27;tags[0].appendChild(tag);}%20var%20loc%20=%20new%20String(window.location);%20if(loc.match(%2Fhttp:\\%2F\\%2F.*?xanga.com%2F)){var%20tmp%20=%20loc.split(%27%2F%27);var%20tag%20=%20document.createElement(%27link%27);var%20xangauser%20=%20tmp[3];xangauser%20=%20xangauser.replace(%2Fhome.aspx?user=%2F,%27%27);tag.href=%27http:%2F%2Fwww.xanga.com%2Frss.aspx?user=%27%2BencodeURIComponent(xangauser);tag.rel=%27alternate%27;document.body.appendChild(tag);}%20var%20thelink=false;%20var%20linktags%20=%20document.getElementsByTagName(%27link%27);%20for(var%20i=0;i<linktags.length;i%2B%2B)%20{if(linktags[i].href%20&&%20linktags[i].rel.match(%2F.*alternate.*%2F)){thelink=linktags[i];break;}}%20%20if(!thelink)%20{linktags%20=%20document.getElementsByTagName(%27a%27);%20for(var%20i=0;i<linktags.length;i%2B%2B)%20{if(linktags[i].href%20&&%20linktags[i].rel.match(%2F.*alternate.*%2F)){thelink=linktags[i];break;}}}%20if(thelink%20&&%20thelink.href)%20window.location=%27http:%2F%2Fwww.awriterz.org%2Fetcetc%2Fboxtheweb%2Fupdateboxes.php?type=feed&contents=%27%2BencodeURIComponent(thelink.href)%2B%27&width=400&summary=on&newbox=1&redirect_to=%27%2Bwindow.location;%20else%20{%20if(confirm(%27This%20page%20appears%20to%20have%20no%20valid%20feed...%20try%20to%20add%20anyway?%27))%20window.location=%27http:%2F%2Fwww.awriterz.org%2Fetcetc%2Fboxtheweb%2Fupdateboxes.php?type=feed&contents=%27%2BencodeURIComponent(window.location)%2B%27&width=400&summary=on&newbox=1&redirect_to%27%2Bwindow.location;%20}})();
+
 
-
* <span class="jslink" title="hi">Add2BtW</span> -- default max items to unread items
+
* <span class="jslink" title="Add2BtW">javascript:(function(){var%20tags%20=%20document.getElementsByTagName(%27channel%27);%20if(tags.length%20%3E%200)%20{var%20tag%20=%20document.createElement(%27link%27);tag.href=window.location;tag.rel=%27alternate%27;tags[0].appendChild(tag);}%20tags%20=%20document.getElementsByTagName(%27feed%27);%20if(tags.length%20%3E%200)%20{var%20tag%20=%20document.createElement(%27link%27);tag.href=window.location;tag.rel=%27alternate%27;tags[0].appendChild(tag);}%20var%20loc%20=%20new%20String(window.location);%20if(loc.match(%2Fhttp:\\%2F\\%2F.*?xanga.com%2F)){var%20tmp%20=%20loc.split(%27%2F%27);var%20tag%20=%20document.createElement(%27link%27);var%20xangauser%20=%20tmp[3];xangauser%20=%20xangauser.replace(%2Fhome.aspx?user=%2F,%27%27);tag.href=%27http:%2F%2Fwww.xanga.com%2Frss.aspx?user=%27%2BencodeURIComponent(xangauser);tag.rel=%27alternate%27;document.body.appendChild(tag);}%20var%20thelink=false;%20var%20linktags%20=%20document.getElementsByTagName(%27link%27);%20for(var%20i=0;i<linktags.length;i%2B%2B)%20{if(linktags[i].href%20&&%20linktags[i].rel.match(%2F.*alternate.*%2F)){thelink=linktags[i];break;}}%20%20if(!thelink)%20{linktags%20=%20document.getElementsByTagName(%27a%27);%20for(var%20i=0;i<linktags.length;i%2B%2B)%20{if(linktags[i].href%20&&%20linktags[i].rel.match(%2F.*alternate.*%2F)){thelink=linktags[i];break;}}}%20if(thelink%20&&%20thelink.href)%20window.location=%27http:%2F%2Fboxtheweb.mihopa.net%2Fupdateboxes.php?type=feed&contents=%27%2BencodeURIComponent(thelink.href)%2B%27&width=400&summary=on&newbox=1&redirect_to=%27%2Bwindow.location;%20else%20{%20if(confirm(%27This%20page%20appears%20to%20have%20no%20valid%20feed...%20try%20to%20add%20anyway?%27))%20window.location=%27http:%2F%2Fboxtheweb.mihopa.net%2Fupdateboxes.php?type=feed&contents=%27%2BencodeURIComponent(window.location)%2B%27&width=400&summary=on&newbox=1&redirect_to%27%2BencodeURIComponent(window.location);%20}})();</span> -- default max items to unread items
-
* <span class="jslink" title="javascript:(function(){var%20tags%20=%20document.getElementsByTagName(%27channel%27);%20if(tags.length%20>%200)%20{var%20tag%20=%20document.createElement(%27link%27);tag.href=window.location;tag.rel=%27alternate%27;tags[0].appendChild(tag);}%20tags%20=%20document.getElementsByTagName(%27feed%27);%20if(tags.length%20>%200)%20{var%20tag%20=%20document.createElement(%27link%27);tag.href=window.location;tag.rel=%27alternate%27;tags[0].appendChild(tag);}%20var%20loc%20=%20new%20String(window.location);%20if(loc.match(%2Fhttp:\\%2F\\%2F.*?xanga.com%2F)){var%20tmp%20=%20loc.split(%27%2F%27);var%20tag%20=%20document.createElement(%27link%27);var%20xangauser%20=%20tmp[3];xangauser%20=%20xangauser.replace(%2Fhome.aspx?user=%2F,%27%27);tag.href=%27http:%2F%2Fwww.xanga.com%2Frss.aspx?user=%27%2BencodeURIComponent(xangauser);tag.rel=%27alternate%27;document.body.appendChild(tag);}%20var%20thelink=false;%20var%20linktags%20=%20document.getElementsByTagName(%27link%27);%20for(var%20i=0;i<linktags.length;i%2B%2B)%20{if(linktags[i].href%20&&%20linktags[i].rel.match(%2F.*alternate.*%2F)){thelink=linktags[i];break;}}%20%20if(!thelink)%20{linktags%20=%20document.getElementsByTagName(%27a%27);%20for(var%20i=0;i<linktags.length;i%2B%2B)%20{if(linktags[i].href%20&&%20linktags[i].rel.match(%2F.*alternate.*%2F)){thelink=linktags[i];break;}}}%20if(thelink%20&&%20thelink.href)%20window.location=%27http:%2F%2Fwww.awriterz.org%2Fetcetc%2Fboxtheweb%2Fupdateboxes.php?type=feed&contents=%27%2BencodeURIComponent(thelink.href)%2B%27&width=400&max=3&summary=on&newbox=1&redirect_to=%27%2Bwindow.location;%20else%20{%20if(confirm(%27This%20page%20appears%20to%20have%20no%20valid%20feed...%20try%20to%20add%20anyway?%27))%20window.location=%27http:%2F%2Fwww.awriterz.org%2Fetcetc%2Fboxtheweb%2Fupdateboxes.php?type=feed&contents=%27%2BencodeURIComponent(window.location)%2B%27&width=400&max=3&summary=on&newbox=1&redirect_to%27%2Bwindow.location;%20}})();">Add2BtW</span> -- default max items to 3
+
* <span class="jslink" title="Add2BtW">javascript:(function(){var%20tags%20=%20document.getElementsByTagName(%27channel%27);%20if(tags.length%20>%200)%20{var%20tag%20=%20document.createElement(%27link%27);tag.href=window.location;tag.rel=%27alternate%27;tags[0].appendChild(tag);}%20tags%20=%20document.getElementsByTagName(%27feed%27);%20if(tags.length%20>%200)%20{var%20tag%20=%20document.createElement(%27link%27);tag.href=window.location;tag.rel=%27alternate%27;tags[0].appendChild(tag);}%20var%20loc%20=%20new%20String(window.location);%20if(loc.match(%2Fhttp:\\%2F\\%2F.*?xanga.com%2F)){var%20tmp%20=%20loc.split(%27%2F%27);var%20tag%20=%20document.createElement(%27link%27);var%20xangauser%20=%20tmp[3];xangauser%20=%20xangauser.replace(%2Fhome.aspx?user=%2F,%27%27);tag.href=%27http:%2F%2Fwww.xanga.com%2Frss.aspx?user=%27%2BencodeURIComponent(xangauser);tag.rel=%27alternate%27;document.body.appendChild(tag);}%20var%20thelink=false;%20var%20linktags%20=%20document.getElementsByTagName(%27link%27);%20for(var%20i=0;i<linktags.length;i%2B%2B)%20{if(linktags[i].href%20&&%20linktags[i].rel.match(%2F.*alternate.*%2F)){thelink=linktags[i];break;}}%20%20if(!thelink)%20{linktags%20=%20document.getElementsByTagName(%27a%27);%20for(var%20i=0;i<linktags.length;i%2B%2B)%20{if(linktags[i].href%20&&%20linktags[i].rel.match(%2F.*alternate.*%2F)){thelink=linktags[i];break;}}}%20if(thelink%20&&%20thelink.href)%20window.location=%27http:%2F%2Fboxtheweb.mihopa.net%2Fupdateboxes.php?type=feed&contents=%27%2BencodeURIComponent(thelink.href)%2B%27&width=400&max=3&summary=on&newbox=1&redirect_to=%27%2Bwindow.location;%20else%20{%20if(confirm(%27This%20page%20appears%20to%20have%20no%20valid%20feed...%20try%20to%20add%20anyway?%27))%20window.location=%27http:%2F%2Fboxtheweb.mihopa.net%2Fupdateboxes.php?type=feed&contents=%27%2BencodeURIComponent(window.location)%2B%27&width=400&max=3&summary=on&newbox=1&redirect_to%27%2BencodeURIComponent(window.location);%20}})();</span> -- default max items to 3
Then when you come to a page whose feed you want to add to your BoxtheWeb (or to a feed page) you can click the bookmark you just created and it will automatically add it to your BoxtheWeb and then bring you back to the page.
Then when you come to a page whose feed you want to add to your BoxtheWeb (or to a feed page) you can click the bookmark you just created and it will automatically add it to your BoxtheWeb and then bring you back to the page.
[[Category:Tips]]
[[Category:Tips]]

Current revision as of 19:11, 13 January 2007

The bookmarklet is still experimental at this point. To use it drag one of the following links to your bookmarks bar or add to your favourites:

  • javascript:(function(){var%20tags%20=%20document.getElementsByTagName(%27channel%27);%20if(tags.length%20%3E%200)%20{var%20tag%20=%20document.createElement(%27link%27);tag.href=window.location;tag.rel=%27alternate%27;tags[0].appendChild(tag);}%20tags%20=%20document.getElementsByTagName(%27feed%27);%20if(tags.length%20%3E%200)%20{var%20tag%20=%20document.createElement(%27link%27);tag.href=window.location;tag.rel=%27alternate%27;tags[0].appendChild(tag);}%20var%20loc%20=%20new%20String(window.location);%20if(loc.match(%2Fhttp:\\%2F\\%2F.*?xanga.com%2F)){var%20tmp%20=%20loc.split(%27%2F%27);var%20tag%20=%20document.createElement(%27link%27);var%20xangauser%20=%20tmp[3];xangauser%20=%20xangauser.replace(%2Fhome.aspx?user=%2F,%27%27);tag.href=%27http:%2F%2Fwww.xanga.com%2Frss.aspx?user=%27%2BencodeURIComponent(xangauser);tag.rel=%27alternate%27;document.body.appendChild(tag);}%20var%20thelink=false;%20var%20linktags%20=%20document.getElementsByTagName(%27link%27);%20for(var%20i=0;i<linktags.length;i%2B%2B)%20{if(linktags[i].href%20&&%20linktags[i].rel.match(%2F.*alternate.*%2F)){thelink=linktags[i];break;}}%20%20if(!thelink)%20{linktags%20=%20document.getElementsByTagName(%27a%27);%20for(var%20i=0;i<linktags.length;i%2B%2B)%20{if(linktags[i].href%20&&%20linktags[i].rel.match(%2F.*alternate.*%2F)){thelink=linktags[i];break;}}}%20if(thelink%20&&%20thelink.href)%20window.location=%27http:%2F%2Fboxtheweb.mihopa.net%2Fupdateboxes.php?type=feed&contents=%27%2BencodeURIComponent(thelink.href)%2B%27&width=400&summary=on&newbox=1&redirect_to=%27%2Bwindow.location;%20else%20{%20if(confirm(%27This%20page%20appears%20to%20have%20no%20valid%20feed...%20try%20to%20add%20anyway?%27))%20window.location=%27http:%2F%2Fboxtheweb.mihopa.net%2Fupdateboxes.php?type=feed&contents=%27%2BencodeURIComponent(window.location)%2B%27&width=400&summary=on&newbox=1&redirect_to%27%2BencodeURIComponent(window.location);%20}})(); -- default max items to unread items
  • javascript:(function(){var%20tags%20=%20document.getElementsByTagName(%27channel%27);%20if(tags.length%20>%200)%20{var%20tag%20=%20document.createElement(%27link%27);tag.href=window.location;tag.rel=%27alternate%27;tags[0].appendChild(tag);}%20tags%20=%20document.getElementsByTagName(%27feed%27);%20if(tags.length%20>%200)%20{var%20tag%20=%20document.createElement(%27link%27);tag.href=window.location;tag.rel=%27alternate%27;tags[0].appendChild(tag);}%20var%20loc%20=%20new%20String(window.location);%20if(loc.match(%2Fhttp:\\%2F\\%2F.*?xanga.com%2F)){var%20tmp%20=%20loc.split(%27%2F%27);var%20tag%20=%20document.createElement(%27link%27);var%20xangauser%20=%20tmp[3];xangauser%20=%20xangauser.replace(%2Fhome.aspx?user=%2F,%27%27);tag.href=%27http:%2F%2Fwww.xanga.com%2Frss.aspx?user=%27%2BencodeURIComponent(xangauser);tag.rel=%27alternate%27;document.body.appendChild(tag);}%20var%20thelink=false;%20var%20linktags%20=%20document.getElementsByTagName(%27link%27);%20for(var%20i=0;i<linktags.length;i%2B%2B)%20{if(linktags[i].href%20&&%20linktags[i].rel.match(%2F.*alternate.*%2F)){thelink=linktags[i];break;}}%20%20if(!thelink)%20{linktags%20=%20document.getElementsByTagName(%27a%27);%20for(var%20i=0;i<linktags.length;i%2B%2B)%20{if(linktags[i].href%20&&%20linktags[i].rel.match(%2F.*alternate.*%2F)){thelink=linktags[i];break;}}}%20if(thelink%20&&%20thelink.href)%20window.location=%27http:%2F%2Fboxtheweb.mihopa.net%2Fupdateboxes.php?type=feed&contents=%27%2BencodeURIComponent(thelink.href)%2B%27&width=400&max=3&summary=on&newbox=1&redirect_to=%27%2Bwindow.location;%20else%20{%20if(confirm(%27This%20page%20appears%20to%20have%20no%20valid%20feed...%20try%20to%20add%20anyway?%27))%20window.location=%27http:%2F%2Fboxtheweb.mihopa.net%2Fupdateboxes.php?type=feed&contents=%27%2BencodeURIComponent(window.location)%2B%27&width=400&max=3&summary=on&newbox=1&redirect_to%27%2BencodeURIComponent(window.location);%20}})(); -- default max items to 3

Then when you come to a page whose feed you want to add to your BoxtheWeb (or to a feed page) you can click the bookmark you just created and it will automatically add it to your BoxtheWeb and then bring you back to the page.

Personal tools