[Greasemonkey] "Bloglines Keep All New Link" User script
Robert Kim Wireless Internet Advisor
evdo.hsdpa at gmail.com
Tue Jun 14 10:06:27 EDT 2005
Nick, Thanks! bob
On 6/2/05, Nicola Paolucci <durden at gmail.com> wrote:
> Hi All,
>
> While I find a permanent home for this useful small user script, I
> release it to the world here.
>
> It is my very first greasemonkey script so bear with me if you room
> for improvement. Feedback is of course welcome!
>
> ciao !
> Nick
>
> // "Bloglines Keep All New Link" User script
> // version 0.1 BETA!
> // 2005-06-01
> // Copyright (c) 2005, Nicola Paolucci
> // Released under the BSD license
> //
> // --------------------------------------------------------------------
> //
> // This is a Greasemonkey user script.
> //
> // To install, you need Greasemonkey: http://greasemonkey.mozdev.org/
> // Then restart Firefox and revisit this script.
> // Under Tools, there will be a new menu item to "Install User Script".
> // Accept the default configuration and install.
> //
> // To uninstall, go to Tools/Manage User Scripts,
> // select "Bloglines Keep All New Link", and click Uninstall.
> //
> // --------------------------------------------------------------------
> //
> // ==UserScript==
> // @name Bloglines Keep All New Link
> // @namespace http://www.durdn.net/greasemonkey
> // @description Adds a new "keep all new" link to every blog page. If
> you have a big list of entries in a blog and you are sure you will not
> be able to read them in one session. You can click the "keep all new"
> link and then untick the entries while you read them one by one.
> // @include http://www.bloglines.com/myblogs_display*
> // ==/UserScript==
>
> var embeddedjs = document.createElement("script");
> embeddedjs.innerHTML = 'function xpath(query) {' +
> ' return document.evaluate(query, document, null,' +
> '
> XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);' +
> '}' +
> 'function delay(gap){ /* gap is in millisecs */' +
> ' var then,now; then=new Date().getTime();' +
> ' now=then;' +
> ' while((now-then)<gap)' +
> ' {now=new Date().getTime();}' +
> '}' +
> 'function checkAllKeepNewBoxes() {' +
> ' allElements = xpath("//input[@type = \'checkbox\']");' +
> ' for (var i = 0; i < allElements.snapshotLength; i++) {' +
> ' thisElement = allElements.snapshotItem(i);' +
> ' prms = thisElement.id.split("-");' +
> ' prms[0] = prms[0].substring(4,prms[0].length);' +
> ' thisElement.checked = true;' +
> ' markUnreadItem(prms[0],prms[1]);' +
> ' delay(1000);' +
> ' }' +
> '}';
>
> function delay(gap){ /* gap is in millisecs */
> var then,now; then=new Date().getTime();
> now=then;
> while((now-then)<gap)
> {now=new Date().getTime();}
> }
>
> function xpath(query) {
> return document.evaluate(query, document, null,
> XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
> }
>
> function addKeepAllNewLink() {
> allElements = xpath("//ul[@class = 'channel_nav']/li");
> thisElement = allElements.snapshotItem(0);
> if (thisElement) {
> newli = document.createElement('li');
> newli.innerHTML = '<a
> href="javascript:checkAllKeepNewBoxes()">keep all new</a>';
> thisElement.parentNode.insertBefore(newli, thisElement);
> }
> }
>
> (function() {
> if (document.title == "Bloglines | My Blogs") {
> document.body.insertBefore(embeddedjs, document.body.firstChild);
> addKeepAllNewLink();
> }
> })();
>
>
--
Robert Q Kim, Wireless Internet Advisor
http://evdo-coverage.com
http://wirelessinternetcoverage.com
http://hsdpa-coverage.com
2611 S. Pacific Coast Highway 101
Suite 102
Cardiff by the Sea, CA 92007
206 984 0880
More information about the Greasemonkey
mailing list