Archived Comments (locked)
|
|
The following is an archive of comments made before threaded discussions was implemented (November 16th, 2008) |
|
|
For what it's worth the script has been broken again by changes to Google Reader. I'm stumped this time as Google Reader now seems to be dynamically generating much of the page content which prevents us from tapping into it from GreaseMonkey? at least its effective at barring someone with my level of knowledge (low javascript foo). |
|
|
Here is the completely patched script.
// GoogleReaderAllStarred
// version 0.5
// 2005-12-13
// Copyright (c) 2005, Ben Beckwith
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script. To install it, you need
// Greasemonkey 0.3 or later: 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.
//
// --------------------------------------------------------------------
// There are a couple of extra ideas I had for this, but these may need
// 1.) Make it easy to post all to del.icio.us
// 2.) Automatic/batch unstar of all items
//
// --------------------------------------------------------------------
// Changes
// 0.5 bnb
// Updated to work with the latest Reader
// 0.1.1 bnb
// Updated script to work with the new GR XML file for starred items
// 0.1 bnb
// Initial Version
//
// --------------------------------------------------------------------
//
//
// ==UserScript==
// @name Google Reader All Starred
// @namespace http://whitebucket.com/greasemonkey
// @description Script to extract all links from google reader that have been starred.
// @include http://*.google.com/reader/*
// @include http://google.com/reader/*
// @include http://reader.google.com/*
// ==/UserScript==
// Be informative for older versions of Greasemonkey
if (!GM_xmlhttpRequest) {
alert('Please upgrade to the latest version of Greasemonkey.');
return;
}
// The variable to hold the page output
var links = '';
// Get the userid from the script on the page
var uid = unsafeWindow["_USER_ID"];
// Page number variable for output
var pages;
// kick off the collection
function getAllStarred()
{
// Set the text for the message box
document.getElementById('GRAS_MSG').innerHTML = 'Getting links.';
// Show the message box
document.getElementById('GRAS_DIV').style.display = 'block';
// Initialize the page variable
pages = 1;
// Begin the new links page
links = '<head><title>Google Reader Starred Entries</title></head><html>' +
// '<input />' +
// '<input />' +
' ' + '
<input />' + // ' <label>Your del.icio.us Password:</label> <input />' + // ' <label>Del.icio.us tags to use:</label> <input />' + // ' <input />'; // } // function unstarLinks() // { // alert("When I wish upon a star...."); // } // Add a small messagebox to indicate that the script is working var msg = document.createElement("div"); msg.innerHTML = ' ' + 'YOUR TEXT HERE ' + ' |
|
|
Thanks Mark. |
|
|
Script was only getting the first 250 for me.. it seems the "continuation" element is now called "gr:continuation".. fixing this in the script gets it working again Now I have extracted all my 7530 starred item links from Google Reader :) Edit: Some of the extracted links are of the form "tag:" which I understand is something to do with Atom, however I needed real links - adding the following gets the real link in most cases I have seen where "tag:..." is used: find:
var link = entries[i].getElementsByTagName('id')[0].getAttribute('gr:original-id');
add the following after the above line:
if (!(/^http/.test(link))) {
link = entries[i].getElementsByTagName('link')[0].getAttribute('href');
}
|
|
|
Well ok, Now I have my 3000+ links, I would like to "unstar" them and make room for new "stars" . Would you know how to this this? I think some tweak in this script should be able to handle this well. |
|
|
Ah, just applied my own patch to the office computer and it wasn't quite right. Forget to escape the angle brackets around the "All Starred" link so the forum removed them. I modified the patch below so you might want to patch again. It's a cosmetic issue that meant "All Starred" wasn't being rendered as a link - but would still work when clicked. |
|
|
Super Richard. I owe you a beer! |
|
|
Noticed it had stopped working recently. Had a crack at patching it myself, edit the script and look for the line that starts
|
|
|
Doesnt seems to work with new reader :( |