<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>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 &quot;Install User Script&quot;.
// 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[&quot;_USER_ID&quot;];
// 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 = '&lt;head&gt;&lt;title&gt;Google Reader Starred Entries&lt;/title&gt;&lt;/head&gt;&lt;html&gt;' +
	//	'&lt;input type=&quot;button&quot; value=&quot;Push to del.icio.us&quot; id=&quot;GRAS_DELICIOUS&quot;&gt;' +
	//      '&lt;input type=&quot;button&quot; value=&quot;Unstar items&quot; id=&quot;GRAS_UNSTAR&quot; onClick=&quot;alert(window.location.href)&quot;&gt;' +
	'&lt;br&gt;&lt;div id=&quot;GRAS_ACTIONFORM&quot;&gt;&lt;/div&gt;' +
	'&lt;ul&gt;';
    
    // Make the initial request
    // The 'continuation' string isn't needed for the first request.
    googleRequest('');
}

// Perform the request for the starred item
// Param: c
//        This string is used as an offset if the initial
//        request didn't get all of starred items
//
function googleRequest(c){
    // Generate a request to get the list (xml) of starred items
    GM_xmlhttpRequest({
	    method: 'GET',
    		url: 'http://google.com/reader/atom/user/' + uid + '/state/com.google/starred?n=250'+c,
    		headers: {
		'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey/0.3',
		    'Accept': 'application/atom+xml,application/xml,text/xml',
		    },
    		onload: collectAllStarred
		});
}

// This function parses the response object to get the starred items.
// If it finds a continuation parameter, it will call googleRequest
// again until all of the starred items are collected.
function collectAllStarred(responseObj)
{
    document.getElementById('GRAS_MSG').innerHTML = 'Collecting links,  Set ' + pages++;
    // Create a new parser
    var dp = new XPCNativeWrapper(window, &quot;DOMParser()&quot;);
    var parser = new dp.DOMParser();
    var DOM = parser.parseFromString(responseObj.responseText, &quot;application/xhtml+xml&quot;);
    
    // Grab all of the entries
    var entries = DOM.getElementsByTagName('entry');
    
    // Loop through all of the entries
    for(var i = 0, len = entries.length; i &lt; len; i++){
	// Grab the link URL
	var link = entries[i].getElementsByTagName('id')[0].getAttribute('gr:original-id');
	
	if (!(/^http/.test(link))) {
		link = entries[i].getElementsByTagName('link')[0].getAttribute('href');
	} 

	// Grab the item Title
	var title = entries[i].getElementsByTagName('title')[0].childNodes[0].nodeValue;
	// Grab the feed name
	var feedtitle = entries[i].getElementsByTagName('source')[0].getElementsByTagName('title')[0].textContent
	    // Add a new link to the page.
	    links += '&lt;li&gt;&lt;a href=&quot;' + link + '&quot;&gt;' + title + ' from ' + feedtitle +'&lt;/a&gt;&lt;/li&gt;\n';
	
	// Note that other fields can be displayed here as well.
    }
    
    // Check for continuation
    if(DOM.getElementsByTagName('gr:continuation')[0]){
	googleRequest('&amp;c=' + DOM.getElementsByTagName('gr:continuation')[0].childNodes[0].nodeValue); 
    }else{
	// If there is no continuation, then we have finished and it is time to display the page
	
	// tidy up the page.
	links += &quot;&lt;/ul&gt;&lt;/html&gt;&quot;;
	
	// Write a new document (another window)
	var d = open().document;
	d.write(links);
	d.close();
	
	// Hide the message box		
	document.getElementById('GRAS_DIV').style.display = 'none';
    }
}

// function pushToDelicious()
// {
    
// }

// function showDeliciousForm()
// {
//     alert('Clicked');
//     document.getElementById('GRAS_ACTIONFORM').innerHTML = 
// 	'&lt;FORM&gt;&lt;label for=&quot;d_id&quot;&gt;Your del.icio.us ID:&lt;/label&gt;&lt;BR&gt;&lt;input type=&quot;text&quot; name=&quot;d_id&quot; id=&quot;d_id&quot;&gt;' +
// 	'&lt;br&gt;&lt;label for=&quot;d_pass&quot;&gt;Your del.icio.us Password:&lt;/label&gt;&lt;br&gt;&lt;input type=&quot;text&quot; name=&quot;d_pass&quot; id=&quot;d_pass&quot;&gt;' +
// 	'&lt;br&gt;&lt;label for=&quot;d_tags&quot;&gt;Del.icio.us tags to use:&lt;/label&gt;&lt;br&gt;&lt;input type=&quot;text&quot; name=&quot;d_tags&quot; id=&quot;d_tags&quot;&gt;' +
// 	'&lt;br&gt;&lt;input type=&quot;button&quot; onClick=&quot;alert(window.location.href)&quot; value=&quot;Go!&quot;&gt;';
// }

// function unstarLinks()
// {
//     alert(&quot;When I wish upon a star....&quot;);
// }

// Add a small messagebox to indicate that the script is working
var msg = document.createElement(&quot;div&quot;);
msg.innerHTML = '&lt;div id=&quot;GRAS_DIV&quot; style=&quot;margin: 0 auto 0 auto; ' +
    'position: absolute; top: 5px; left: 5px; display: none;'+
    'border: 2px solid #000000; margin-bottom: 5px; ' +
    'font-size: small; background-color: #bb0000; ' +
    'color: #eeffff;&quot;&gt;&lt;p id=&quot;GRAS_MSG&quot; style=&quot;margin: 2px 0 1px 0;&quot;&gt; ' +
    'YOUR TEXT HERE ' +
    '&lt;/p&gt;&lt;/div&gt;';
// Add it at the end of the page.
document.body.appendChild(msg);

if(document.getElementById('selectors-container') &amp;&amp; document.getElementById('star-selector')) {
// Create a list item to add to the regular google links
var starlink = document.createElement(&quot;li&quot;);
starlink.setAttribute(&quot;class&quot;, &quot;selector&quot;);
starlink.setAttribute(&quot;id&quot;, &quot;all-starred-link&quot;);
// Add the text
starlink.innerHTML='&lt;a href=&quot;#&quot;&gt;All Starred&lt;/a&gt;';
// Create a listener to handle the click event
starlink.addEventListener('click',getAllStarred,false);
// Add the link to the Google Reader page.
document.getElementById('selectors-container').insertBefore(starlink, document.getElementById('star-selector').nextSibling);
} 

// if(document.getElementById('GRAS_DELICIOUS')){
//     document.getElementById('GRAS_DELICIOUS').addEventListener('click',showDeliciousForm,false);
// }
// if(document.getElementById('GRAS_UNSTAR')){
//     document.getElementById('GRAS_UNSTAR').addEventListener('click',unstarLinks,false);
// }</body>
  <body-html>Here is the completely patched script.

// GoogleReaderAllStarred
// version 0.5
// 2005-12-13
// Copyright (c) 2005, Ben Beckwith
// Released under the GPL license
// &lt;a href=&quot;http://www.gnu.org/copyleft/gpl.html&quot;&gt;http://www.gnu.org/copyleft/gpl.html&lt;/a&gt;
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script.  To install it, you need
// Greasemonkey 0.3 or later: &lt;a href=&quot;http://greasemonkey.mozdev.org/&quot;&gt;http://greasemonkey.mozdev.org/&lt;/a&gt;
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to &quot;Install User Script&quot;.
// 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     &lt;a href=&quot;http://whitebucket.com/greasemonkey&quot;&gt;http://whitebucket.com/greasemonkey&lt;/a&gt;
// @description   Script to extract all links from google reader that have been starred.
// @include       &lt;a href=&quot;http://*.google.com/reader/&quot;&gt;http://*.google.com/reader/&lt;/a&gt;*
// @include	  &lt;a href=&quot;http://google.com/reader/&quot;&gt;http://google.com/reader/&lt;/a&gt;*
// @include	  &lt;a href=&quot;http://reader.google.com/&quot;&gt;http://reader.google.com/&lt;/a&gt;*
// ==/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[&quot;_USER_ID&quot;];
// 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 = '&amp;lt;head&gt;&amp;lt;title&gt;Google Reader Starred Entries&amp;lt;/title&gt;&amp;lt;/head&gt;&amp;lt;html&gt;' +
	//	'&amp;lt;input /&gt;' +
	//      '&amp;lt;input /&gt;' +
	'&lt;br /&gt;&lt;div&gt;&lt;/div&gt;' +
	'&lt;ul&gt;';
    
    // Make the initial request
    // The 'continuation' string isn't needed for the first request.
    googleRequest('');
}

// Perform the request for the starred item
// Param: c
//        This string is used as an offset if the initial
//        request didn't get all of starred items
//
function googleRequest(c){
    // Generate a request to get the list (xml) of starred items
    GM_xmlhttpRequest({
	    method: 'GET',
    		url: 'http://google.com/reader/atom/user/' + uid + '/state/com.google/starred?n=250'+c,
    		headers: {
		'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey/0.3',
		    'Accept': 'application/atom+xml,application/xml,text/xml',
		    },
    		onload: collectAllStarred
		});
}

// This function parses the response object to get the starred items.
// If it finds a continuation parameter, it will call googleRequest
// again until all of the starred items are collected.
function collectAllStarred(responseObj)
{
    document.getElementById('GRAS_MSG').innerHTML = 'Collecting links,  Set ' + pages++;
    // Create a new parser
    var dp = new XPCNativeWrapper(window, &quot;DOMParser()&quot;);
    var parser = new dp.DOMParser();
    var DOM = parser.parseFromString(responseObj.responseText, &quot;application/xhtml+xml&quot;);
    
    // Grab all of the entries
    var entries = DOM.getElementsByTagName('entry');
    
    // Loop through all of the entries
    for(var i = 0, len = entries.length; i &amp;lt; len; i++){
	// Grab the link URL
	var link = entries[i].getElementsByTagName('id')[0].getAttribute('gr:original-id');
	
	if (!(/^http/.test(link))) {
		link = entries[i].getElementsByTagName('link')[0].getAttribute('href');
	} 

	// Grab the item Title
	var title = entries[i].getElementsByTagName('title')[0].childNodes[0].nodeValue;
	// Grab the feed name
	var feedtitle = entries[i].getElementsByTagName('source')[0].getElementsByTagName('title')[0].textContent
	    // Add a new link to the page.
	    links += '&lt;li&gt;&lt;a href=&quot;' + link + '&quot;&gt;' + title + ' from ' + feedtitle +'&lt;/a&gt;&lt;/li&gt;\n';
	
	// Note that other fields can be displayed here as well.
    }
    
    // Check for continuation
    if(DOM.getElementsByTagName('gr:continuation')[0]){
	googleRequest('&amp;amp;c=' + DOM.getElementsByTagName('gr:continuation')[0].childNodes[0].nodeValue); 
    }else{
	// If there is no continuation, then we have finished and it is time to display the page
	
	// tidy up the page.
	links += &quot;&lt;/ul&gt;&amp;lt;/html&gt;&quot;;
	
	// Write a new document (another window)
	var d = open().document;
	d.write(links);
	d.close();
	
	// Hide the message box		
	document.getElementById('GRAS_DIV').style.display = 'none';
    }
}

// function pushToDelicious()
// {
    
// }

// function showDeliciousForm()
// {
//     alert('Clicked');
//     document.getElementById('GRAS_ACTIONFORM').innerHTML = 
// 	'&amp;lt;form&gt;&amp;lt;label&gt;Your del.icio.us ID:&amp;lt;/label&gt;&lt;br /&gt;&amp;lt;input /&gt;' +
// 	'&lt;br /&gt;&amp;lt;label&gt;Your del.icio.us Password:&amp;lt;/label&gt;&lt;br /&gt;&amp;lt;input /&gt;' +
// 	'&lt;br /&gt;&amp;lt;label&gt;Del.icio.us tags to use:&amp;lt;/label&gt;&lt;br /&gt;&amp;lt;input /&gt;' +
// 	'&lt;br /&gt;&amp;lt;input /&gt;';
// }

// function unstarLinks()
// {
//     alert(&quot;When I wish upon a star....&quot;);
// }

// Add a small messagebox to indicate that the script is working
var msg = document.createElement(&quot;div&quot;);
msg.innerHTML = '&lt;div&gt;&lt;p&gt; ' +
    'YOUR TEXT HERE ' +
    '&lt;/p&gt;&lt;/div&gt;';
// Add it at the end of the page.
document.body.appendChild(msg);

if(document.getElementById('selectors-container') &amp;amp;&amp;amp; document.getElementById('star-selector')) {
// Create a list item to add to the regular google links
var starlink = document.createElement(&quot;li&quot;);
starlink.setAttribute(&quot;class&quot;, &quot;selector&quot;);
starlink.setAttribute(&quot;id&quot;, &quot;all-starred-link&quot;);
// Add the text
starlink.innerHTML='&lt;a href=&quot;#&quot;&gt;All Starred&lt;/a&gt;';
// Create a listener to handle the click event
starlink.addEventListener('click',getAllStarred,false);
// Add the link to the Google Reader page.
document.getElementById('selectors-container').insertBefore(starlink, document.getElementById('star-selector').nextSibling);
} 

// if(document.getElementById('GRAS_DELICIOUS')){
//     document.getElementById('GRAS_DELICIOUS').addEventListener('click',showDeliciousForm,false);
// }
// if(document.getElementById('GRAS_UNSTAR')){
//     document.getElementById('GRAS_UNSTAR').addEventListener('click',unstarLinks,false);
// }&amp;lt;/form&gt;</body-html>
  <created-at type="datetime">2008-07-25T06:05:33Z</created-at>
  <forumable-id type="integer">2345</forumable-id>
  <forumable-type>Script</forumable-type>
  <id type="integer">66578</id>
  <topic-id type="integer">15825</topic-id>
  <updated-at type="datetime">2008-11-17T00:12:54Z</updated-at>
  <user-agent nil="true"></user-agent>
  <user-id type="integer">54966</user-id>
</post>
