Thursday, May 14, 2015

Gleebox fix for Google Reader command (using TT-RSS)

I'm a fan of Gleebox, especially since I'm getting older and marathon surf sessions can cause my elbow to ache (from reaching for the mouse, then the keyboard, then the mouse).  Using Gleebox saves wear and tear on my elbow and speeds up navigation across sites/pages.

One of Gleebox's drawbacks is that it hasn't been updated in awhile.  One notable broken part is the "open feed in Google Reader" option (Google Reader has been offline for years).  If you have your own TT-RSS instance, or have access to someone else's, the following steps will "re-purpose" the !rss command.

Assuming that you already have Gleebox installed as a Chrome extension on your workstation:

1) Find the pagecmd.js file.  On my desktop, it is located in:


2) Open pagecmd.js in your favorite editor and look for the following lines:
// rss: Opens the rss feed of page in google reader
Glee.getRSSLink = function(newtab) {
  // code via bookmark for google reader
  var b = document.body;var GR________bookmarklet_domain = '';if (b && !document.xmlVersion) {void(z = document.createElement('script'));void(z.src = '');void(b.appendChild(z));}else {location = '' + encodeURIComponent(location.href)}
Make them look like:
Glee.getRSSLink = function(newtab) {
  if(newtab) {
Note: there should be no carriage return between "public.php?" and "op=subscribe".  That should be a single line, starting with "Glee.Browser.openURL" and ending with "newtab,true);".  Of course, you should also edit the line so that the location of your TT-RSS server is accurate.

3) Close your browser, wait a few seconds, and open Chrome again.  Visit a page with an RSS feed and attempt to run the Gleebox "!rss" command.  It should attempt to add the feed to your TT-RSS instance.