GoogleReaderGrowl

By brian dunnington Last update Aug 28, 2009 — Installed 7,668 times.

Better preview text

in
Subscribe to Better preview text 1 post, 1 voice

Brian Baker User
FirefoxWindows

I was getting a blob of HTML as the preview text for new feed items, so I changed that section of the code to look like the following. Now I get the actual item title, sans markup.

It's my first attempt doing anything with Greasemonkey, so beware.

var feed = item.getElementsByClassName('entry-source-title')[0].innerHTML;
var preview = item.getElementsByClassName('entry-title')[0].innerHTML;
var itemE = item.getElementsByClassName('entry-title')[0];
if (itemE.childNodes.length > 0) {
if (itemE.childNodes[0].childNodes.length > 0) {
preview = itemE.childNodes[0].childNodes[0].nodeValue;
}

GrowlMonkey.notify(GoogleReaderGrowl.appname, 'individual', feed, preview);

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel