Script Summary: Mark the entries below, above or between certain entries as read in Google Reader.
Version: 2.1.3
Google Reader's "Mark all as read" is not enough! This script marks some, but not all, of your entries in Google Reader as read, based on criterion you can customize. When you have many entries unread, cannot read all of them at once, and still do not want to miss anything interesting, this script might be useful to you.
After installation, this script creates "Mark below as read" and "Mark above as read" buttons in Google Reader's toolbar. Before using these buttons, select an entry by clicking or keyboard shortcut if you are in the List view mode. It does not matter whether it is expanded or not. Click one of the buttons, and this script will mark entries below or above the selected entry for you.
Press the "q" key to as keyboard shortcut for marking below and "w" for marking above.
You could also mark entries by clicking! By enabling "Click Mark", the script will mark the entries between the current entry and the clicked entry as read. Click Mark will be activated only when holding the shift key. Normal clicks are not affected.
This is a remake of my same-named script Google Reader: Mark some as read (old). In the other script, I mainly simulate keyboard press and mouse click to mark entries read. In this script, I use Google Reader API to achieve the same functionalities. Because the two scripts are significantly different in their implementations, I decide to open this new page for the new script.
The major benefit of this new implementation is, it will NOT scroll the reader panel as marking entries read. Performance is noticeably improved if a large number of unread entries exist. Same as the old script, no refresh is needed in marking. Also, a lot of "stop condition" related variables are not necessary anymore. "Mark below" definitely marks EVERY entry below, even it is not loaded in the reader panel. Marking progress and error messages will be shown in Google Reader's native message area.
Options
Below are the customizable options:
- SHOW_BUTTONS: show or hide "Mark" buttons. (default show)
- KEYPRESS_MARK: enable or disable the keyboard shortcuts. (default enabled)
- CLICK_MARK: enable or disable the "Click Mark" feature. (default enabled)
- RELOAD_AFTER_MARK: reload the page after marking. (default disabled)
Please open the script file to change the options.
The "Mark below as read" and "Mark above as read" buttons
The additional buttons appear in the toolbar as follows:

Known issues
The visual marking in the reader panel may be incorrect while only showing the new items. Fortunately the marking on the server side is correct, meaning you can observe the true marking result after reloading the page.
Starting from version 2.0, the script will NOT work in the following scenarios:
- Only new items are displayed
- Sort by magic is selected
Force using the script in such scenarios may mismark unwanted items. In contrast, the marking performance is significantly increased and network traffic is reduced.
Reference
Although the Google Reader API is available to use, it seems the APIs are still unofficially supported. A good reference to the Google Reader API is available in http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI. Unfortunately, there are still many useful undocumented interfaces.
Version history
2.1.3 on 10/31/2011:
- Support new Google Reader.
2.1.2 on 03/28/2011:
- Optimize code.
2.1.1 on 03/24/2011:
- Fix bug when no at clause is presented.
- Performance optimization when session token is expired.
2.1 on 03/23/2011:
- Intelligent session token retrieval
- Fix bug in session token request.
2.0 on 03/17/2011:
- Employ new API to retrieve item IDs.
- Employ new API to compare items.
- Mark multiple items in one request.
- Bug fix, code refactor and optimization.
- UI improvement.
- Implement a decimal to hexadecimal conversion function for 64-bit numbers.
1.5.5 on 03/11/2011:
- Improve XPath performance.
- Fix bug of ajax request in unread_entry().
1.5.4 on 03/10/2011:
- Add option to force requesting a session token each time the marking starts.
1.5.3 on 03/09/2011:
- Fix bug that current stream ID cannot be retrieved.
1.5.2 on 03/08/2011:
- Fix bug that script crashes when any unread entry has no original link.
- Swap single quotes and double quotes in the script.
1.5.1 on 03/08/2011:
- Fix bug that entries from feeds other than the current are mismarked.
1.5 on 03/06/2011:
- Turn synchronized marking model to asynchronized.
History of versions earlier than 1.5 can be referred in the script file.



