Download script: mod_remove_dupes_from_google.user.js.
Summary
A script, Remove Dupes from Google Reader to remove the display of duplicates in Google Reader was not working and missing desired features. Other scripts didn’t work out. Further details on the situation are available at the posted Ask MetaFilter question.
Resolution
Fixed, enhanced.
New features
The script was corrected to work with Google Reader. It was enhanced so that duplicates were not simply unbolded for a session, a status which was lost on refresh and not reflected in the new items count. Duplicates are now checked by link, as well as the original title plus summary. Duplicates can be marked as read with an automatic refresh to remove them from the new items view by clicking the “Remove Dupes+Refresh” button. The button itself can be right-clicked with the mouse (ctrl-click on single button mouse, context menu click for others) to change to “Remove Dupes Only” and back again. When clicking “Remove Dupes Only”, there is no refresh and duplicates marked as read remain, but are not bolded (the normal message read display).
Remarks
• All messages to be checked for duplicates must be loaded in the viewer. If they are not loaded, they will not be checked.
• The original script was heavily modified. Only a couple of functions from it remain relatively intact.
• To fix the script’s basic operation, a lookup based on bad class name was changed to a valid class name. Miscellaneous bits of noncritical code which bugged me were changed, though not a lot.
• The default “Remove Dupes+Refresh” button performs a duplicate check, then simulates a button press of “Refresh” to force the display to update. If the button is changed to “Remove Dupes Only” by right-clicking on it, the refresh does not occur.
• The enhancement to mark messages as read with Reader stats updates is actually not completely understood by me, and I wrote it. Originally, I thought it could only be done through the poorly and not-officially documented Google Reader API, but this would be a terribly messy process, especially since not all the necessary information could be found.
Instead, I thought to simulate a click on a link for each duplicate to test other ways to make the script work. The links have to be clicked for Google Reader to internally process the message as read in its private data storage. The test approach, I thought, would quickly load each link in the Reader and then the page would go away for subsequent links. This would be suboptimal, but I hoped to later mitigate the page loading to get an acceptable message read process.
Happily, it didn’t happen that way. Instead, the duplicate links were quickly processed and marked as read by the simulated link click, with no external page loading. I’m not sure whether this is because they were processed so quickly, or due to some form of arcana in the parameters passed to the initMouseEvent() function.
Status update
May 19, 2009I’m still online and working on programs, but my iPhone/iPod Touch app development is consuming any time I would normally allocate to writing or fixing scripts (note to developers, the app development environment has failed to impress me). All the scripts I support seem to be working still, but drop me a note if you have any problems or need a quick fix or anything. I can usually make time for small tasks.
I have seen two interesting scripts that are either neglected or trending towards obsolete. Perhaps in the next 3-4 weeks I’ll have time to see what can be done to bring them up to snuff and post back here.