Extra caution is recommended when installing recently uploaded/updated scripts (read more)
Be sure you trust any scripts you install

google reader full feed changer

This script gets contents of reading item on Google Reader. You must set up SITE_INFO in source code.

This script gets contents of reading item on Google Reader.
You must set up SITE_INFO in source code.

/** SITE_INFO example **/

/************************************************/
url: 'Regular Expression of Blog or Feed URL',
xpath: 'xpath of contents'
charset: 'Shift_JIS' // optional

// multi part xpath
url: 'Regular Expression of Blog or Feed URL',
xpath: ['xpath of contents', 'more contents'],
charset: 'Shift_JIS' // optional
/************************************************/

If the domain of feed is different from blog domain, you must write both in SITE_INFO.

For example,

url: 'http://(rssblog.ameba.jp|ameblo.jp)/',

※ 右手だけで使いたいときは「i」とかにキーを割り当てたほうがいいのかも。




Jun 30, 2008
MNakano User

I've written a patch to load a whole entry when it's loaded (currently, when it's focused) in AUTO_FETCH mode so that you won't feel lag to load external contents.

+++++++++++++++++++++++++++++++++++++++++++++++++

-- google_reader_full_feed_.js 2008-06-30 20:28:53 +0100
+++ google_reader_full_feed_.user.js 2008-06-30 21:00:19 +0100
@@ -68,22 +68,30 @@
var AUTO_FETCH = true;
var FullFeed = {};
FullFeed.link = '';
+FullFeed.parentKey = '';
+FullFeed.loaded = 0;
+
FullFeed.getFocusedLink = function() {
return getStringByXPath('//div[@id="current-entry"]//a[@class="entry-title-link"]/@href');
}
-FullFeed.getCurrentEntry = function() {
- var link = this.getFocusedLink();
+
+FullFeed.getCurrentEntry = function(entry) {
+ if (!entry) {
+ entry = getFirstElementByXPath('//div[@id="current-entry"]');
+ }
+
+ var link = getStringByXPath('.//a[@class="entry-title-link"]/@href', entry);
this.link = link;
- var body = getFirstElementByXPath('//div[@id="current-entry"]//div[@class="entry-body"]');
+ var body = getFirstElementByXPath('.//div[@class="entry-body"]', entry);
if (!body) {
- body= getFirstElementByXPath('//div[@id="current-entry"]//div[@class="entry-body entry-body-empty"]');
+ body= getFirstElementByXPath('.//div[@class="entry-body entry-body-empty"]', entry);
}
var source = '';
if (location.href.match(/#stream\/user/)) {
- source = getStringByXPath('//div[@id="current-entry"]//a[@class="entry-source-title"]/@href');
+ source = getStringByXPath('.//a[@class="entry-source-title"]/@href', entry);
}
else if (location.href.match(/#search\//)) {
- source = getStringByXPath('//div[@id="current-entry"]//a[@class="entry-source-title"]/@href');
+ source = getStringByXPath('.//a[@class="entry-source-title"]/@href', entry);
}
else if (location.href.match(/#stream\/feed/)) {
source = getStringByXPath('//div[@id="chrome-stream-title"]//a/@href');
@@ -182,15 +190,26 @@
}

if (AUTO_FETCH) {
- var interval = window.setInterval(
- function() {
- var focusedLink = FullFeed.getFocusedLink();
- if (focusedLink != FullFeed.link) {
- FullFeed.getCurrentEntry();
- }
- },
- 500
+ function autofetch() {
+ var key = document.location.href;
+ if (FullFeed.parentKey != key) {
+ FullFeed.loaded = 0;
+ FullFeed.parentKey = key;
+ }
+
+ var entries = document.evaluate('//div[contains(concat(" ",normalize-space(@class)," "), " entry ")]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
+
+ for (var i = FullFeed.loaded ; i < entries.snapshotLength ; i++) {
+ FullFeed.getCurrentEntry(entries.snapshotItem(i));
+ }
+ FullFeed.loaded = entries.snapshotLength;
+
+ window.setTimeout(
+ autofetch,
+ 500
);
+ }
+ autofetch();
}

document.addEventListener(

+++++++++++++++++++++++++++++++++++++++++++++++++

thank you for the great script!

 
Jun 18, 2008
fkoji Script's author

Thank you for all, and now we released version 0.60.
- Resolved an issue with entry-body-empty
- Multi xpath node

# sorry, we haven't fix redirect link issue yet..

 
Jun 17, 2008
ftofficer User

Cool script. Thank you fkoji.

But there are some issues for empty-content feeds such as wireshark-dev mail list (http://www.wireshark.org/lists/wireshark-dev.rss). I patched the script to make it work:


diff google_reader_full_feed_fixed.user.js google_reader_full_feed.user.js
93,101d77
< if (!body) {
< body = getFirstElementByXPath('//div[@id="current-entry"]//div[@class="entry-body entry-body-empty"]');
< if (!body) {
< return false;
< }
< else {
< body.setAttribute('class', 'entry-body');
< }
< }

 
Jun 14, 2008
JX Wong User

The script is nice!

But it's just load the first node of dom, I think it better to load much node, like this:

xpath: ['//div[@class="entryBody"] | //div[@class="commentTitle"] | //div[@class="comment"]']

the change is simple:

var contents = getElementsByXPath(SITE_INFO[i].xpath, htmldoc);

		if (contents == null) return;

		while (body.firstChild) {
				body.removeChild(body.firstChild);
		}

		for (var num = 0; num < contents.length; num++) {
			var content = contents[num];
			content = addTargetAttr(content);
			body.appendChild(content);
		}

 
Jun 4, 2008
wolfie_liu User

It's a great script!
Except for that you have to click the item so that it can load, hope you can fix it so when you open reader, the items load automatically.
Besides, if the link of the item in the reader get redirected after clicking, it won't work(http://www.cnbeta.com), hope you can fix that too.
ありがとう~!

 
Mar 8, 2008
fkoji Script's author

ver 0.50
Now, we can get contents automatically, without pressing z key.

 
Mar 8, 2008
fkoji Script's author

ver 0.43
Now, we use orverrideMimeType.

 
Mar 8, 2008
Ivan Markovic User

Thank you very much, your script makes life so much easier ;)

 
Mar 7, 2008
fkoji Script's author

If you update this script, you should backup SITE_INFO.

 
Mar 7, 2008
fkoji Script's author

document.addEventListener(
- 'keypress',
+ 'keydown',
function(event) {
- var key = String.fromCharCode(event.charCode);
+ var key = String.fromCharCode(event.keyCode);
- if (key == 'z') {
+ if (key.toLowerCase() == 'z') {
FullFeed.getCurrentEntry();
}
},
false
);

 
Mar 7, 2008
fkoji Script's author

Now, we fix the problem.
Version 0.42 is working.

 
Mar 7, 2008
fkoji Script's author

Thank you for your comment. I also have a same trouble...

 
Mar 7, 2008
Ivan Markovic User

I'm using this script for months and used to be very satisfied with it. But few days ago it just stop working. Is it some change to Google Reader that request for script change? Am I the only one with this behaviour?

You could comment on this script if you were logged in.