LessWrong Power Reader (Greasemonkey script, updated)

post by Wei Dai (Wei_Dai) · 2011-05-24T19:00:21.968Z · LW · GW · Legacy · 28 comments

I posted this script previously to Open Thread, but it got broken by the discussion/main split-up and also didn't work in Firefox 4. It's now updated and fixed for Firefox 4. The original description follows. See the previous thread for some additional questions and answers. (ETA: Firefox 4 seems to have made the script much faster, so try it again if you were previously put off by the slowness.)

For those who may be having trouble keeping up with "Recent Comments" or finding the interface a bit plain, I've written a Greasemonkey script to make it easier/prettier. Here is a screenshot.

Explanation of features:

To install, first get Greasemonkey, then click here. Once that's done, use this link to get to the reader interface.

I've placed the script is in the public domain. EDIT: Chrome is supported as of version 1.0.5 of the script.

On a related note, here is a way to view all posts and comments of a particular LW user as a single HTML page.

EDIT - Version History:

28 comments

Comments sorted by top scores.

comment by Wei Dai (Wei_Dai) · 2011-09-19T01:24:03.689Z · LW(p) · GW(p)

I've updated the script to version 1.0.5. Here are the new changes:

  • loads comments directly from LW instead of through another server
  • added Chrome support
  • auto checking/notification of new versions
  • can specify a starting point to load comments from (if you want, you can read all LW comments, 400 at a time, by starting at comment ID 1)
  • can collapse all comments under a post

It was developed/tested on Windows / Firefox 6.0.2 / Greasemonkey 0.9.11 and Windows / Chrome 14.0.835.163.

comment by pengvado · 2012-07-15T14:53:31.472Z · LW(p) · GW(p)

Bugreport: A recent change to Less Wrong's html generation broke Power Reader's parsing.

Fix: patch / full script

comment by pengvado · 2011-09-16T00:25:02.064Z · LW(p) · GW(p)

Bugreport: I'm getting intermittent failures, wherein http://lesswrong.com/reader instantly returns a blank page (no header, no "Please wait while new comments are being loaded"). When this happens, it also forgets my history of read comments.

Attempted trace: http://www.ibiblio.org/weidai/lesswrong_comments2.php returned http error 500. The forgetting consists of the "remove old ids" loop running on an empty list of new comments, thus thinking that everything is old.

Linux / Firefox 3.6.13 / LessWrong Power Reader 1.0.4

Replies from: Wei_Dai
comment by Wei Dai (Wei_Dai) · 2011-09-16T01:22:56.937Z · LW(p) · GW(p)

Thanks for the report. I've been thinking about changing the script to load comments directly from lesswrong.com instead of through ibiblio.org, and I'll move that up in my todo list. If anyone is hacking on the LW code base, my work would be made much easier (and the script would be faster) if there are APIs to download all comments after a given comment ID, and to download comments that match a set of comment IDs.

ETA: Fixed now

comment by Matt_Simpson · 2011-05-24T19:58:41.148Z · LW(p) · GW(p)

Is there a version of this for Chrome?

Replies from: Wei_Dai
comment by Wei Dai (Wei_Dai) · 2011-05-24T20:10:03.858Z · LW(p) · GW(p)

No. See http://lesswrong.com/lw/2nz/less_wrong_open_thread_september_2010/2lec

Edit: The script now works on Chrome.

Replies from: Matt_Simpson
comment by Matt_Simpson · 2011-05-24T20:16:07.639Z · LW(p) · GW(p)

Ah, I see. Thanks.

comment by bokov · 2013-10-04T03:07:22.587Z · LW(p) · GW(p)

Is this still supported for Firefox 20.0? I went to lesswrong.com/reader and it just stays at " 0 of 800 comments loaded so far" forever.

comment by pengvado · 2011-11-09T06:06:56.568Z · LW(p) · GW(p)

Bugreport (regression since 1.0.4): The like/dislike_author buttons don't work. They do update the "authorPreferences" key in webappstore.sqlite, but they don't affect the display of comments, nor is there any form of UI feedback that the button has been pressed (such as the bolding that used to happen).

Another bug: If there are more than 800 new comments, and I scroll to the bottom of the first page of 800, there's a dynamically generated "There are more comments available" link. If I scroll to the new bottom (which is slightly further along after that link has been appended to the page), then another copy of the same link is appended. Etc.

Linux / Firefox 7.0.1 / LessWrong Power Reader 1.0.6

Replies from: Wei_Dai
comment by Wei Dai (Wei_Dai) · 2011-11-10T00:18:41.231Z · LW(p) · GW(p)

Thanks for the report. Both bugs should be fixed now, as of version 1.0.7. I also changed the script to display 1600 comments at once on Chrome. (800 on Firefox because its javascript engine can't handle that many comments.) You should get an auto-update notice when you visit the reader page.

Replies from: pengvado
comment by pengvado · 2011-11-11T05:31:12.819Z · LW(p) · GW(p)

Thanks for the patch. With 1.0.7, like/dislike_author works for new comments, but doesn't affect old comments that are only displayed because they're parents of new comments.

comment by Wei Dai (Wei_Dai) · 2011-09-19T00:17:00.070Z · LW(p) · GW(p)

Human readers, please ignore this comment. I'm using it to implement update checking for this script.

LessWrong Power Reader Current Version: 1.0.8

comment by NancyLebovitz · 2011-08-30T11:55:00.540Z · LW(p) · GW(p)

I've searched at Grease Monkey, and your script doesn't seem to be there.

Replies from: wedrifid, wedrifid
comment by wedrifid · 2011-08-30T12:00:28.053Z · LW(p) · GW(p)

Did you try clicking on the link that constitutes the third and fourth words of the post? Or the link in the comment by Wei below? I don't have firefox installed this week and I don't think it works with chrome but those seem to link to the script.

Replies from: NancyLebovitz
comment by NancyLebovitz · 2011-08-30T12:39:36.712Z · LW(p) · GW(p)

Thanks, the link you recommended worked.

What happened was that the link in "To install, first get Greasemonkey, then click here. Once that's done, use this link to get to the reader interface." came up blank (I already have Greasemonkey), so then I searched Greasemonkey and didn't find anything.

Replies from: wedrifid
comment by wedrifid · 2011-08-30T13:34:03.013Z · LW(p) · GW(p)

Yeah, I've wondered why Wei didn't throw it up on userscripts.org. Then that firefox plugin would give an icon down in the bottom corner saying "there's a script for this page, click here, click here".

comment by wedrifid · 2011-08-30T11:58:25.743Z · LW(p) · GW(p)

Third and fourth words of the post.

comment by Wei Dai (Wei_Dai) · 2011-05-25T23:36:13.472Z · LW(p) · GW(p)

Damn, it turns out version 1.0.3 of my script still doesn't display the discussion comments. After user evec pointed out the existence of http://lesswrong.com/r/all/new which shows all posts in both main and discussion, I thought that http://lesswrong.com/r/all/comments would similarly show comments in both sections, but it turns out it only shows main comments. So if you want to have the Power Reader display discussion comments as well, upgrade to 1.0.4. It loads up to 200 most recent main comments and 200 most recent discussion comments.

comment by Tyrrell_McAllister · 2011-05-25T05:08:26.425Z · LW(p) · GW(p)

Once that's done, use this link to get to the reader interface.

I installed the script, but when I follow this link, I see the message "The page you requested does not exist".

Replies from: gimpf, Wei_Dai
comment by gimpf · 2011-05-25T13:01:59.889Z · LW(p) · GW(p)

I've got the same problem; at my PC the issue is that the script will not install. Check in the Greasemonkey's "Manage User Scripts..." page whether Wei_Dai's script is there at all.

(edit) I had to use "New User Script...", and then copied the source, for Greasemonkey to accept it at all. Now the script actually shows as active on the URL, though it still does not work, for whatever reason.

comment by Wei Dai (Wei_Dai) · 2011-05-25T05:36:23.651Z · LW(p) · GW(p)

I just took a Firefox 4.0.1 browser, installed Greasemonkey and my script on it, and the link worked fine. If you're not using Firefox 4, try that, and make sure your Greasemonkey is the latest version (0.9.3) and is enabled. If you've done all of that and it still doesn't work, what's your OS? Also, did you restart your browser after you installed Greasemonkey?

Replies from: Tyrrell_McAllister
comment by Tyrrell_McAllister · 2011-05-25T20:56:03.337Z · LW(p) · GW(p)

I'm running Greasemonkey 0.9.3 and Firefox 4.0.1. My OS is Mac OS X 10.6.7. Like gimpf, I had to install the script manually. It now shows up in the Greasemonkey menu as "LessWrong Power Reader" when I go to http://lesswrong.com/reader. However, all that I see on that page is the LW banner, the navigation bar (with "PROMOTED", "NEW", etc.), the message "The page you requested does not exist", and the standard LW footer. The page is otherwise blank.

Might NoScript be interfering somehow? Also, does your LW account have special administrative privileges? Are you able to access the page with a normal user account?

Replies from: Wei_Dai
comment by Wei Dai (Wei_Dai) · 2011-05-25T22:35:08.704Z · LW(p) · GW(p)

I just tried it on Mac OS X 10.6.4 with a fresh installation of Firefox 4.0.1 and Greasemonkey 0.9.3, and the script worked fine. I then installed NoScript, and my script still worked under default settings. There was no need to install the script manually. The script does not require any LW privileges, and in fact works even if you're not logged in (except of course the vote up/down buttons won't work).

I'm not sure what else might be causing the problem, but http://wiki.greasespot.net/Troubleshooting_%28Users%29 has more troubleshooting steps you can try.

(BTW, the reason you see "The page you requested does not exist" is that I picked an arbitrary non-existent LW page as the "trigger" for my script so the fact you see that message means the script either didn't get run, or it failed to do anything.)

Replies from: Tyrrell_McAllister, NihilCredo, Tyrrell_McAllister
comment by Tyrrell_McAllister · 2011-05-29T01:10:17.831Z · LW(p) · GW(p)

Update: It's working for me now.

I don't know exactly what fixed it. I deleted the manually-installed script and disabled all add-ons except Greasemonkey. Then I installed the script again and loaded the reader page. Now the script works even with all add-ons re-enabled. My best guess is that some add-on or other was interfering with the installation process somehow.

comment by NihilCredo · 2011-05-27T19:18:46.825Z · LW(p) · GW(p)

I also get the "this page..." error, but in the Greasemonkey menu the LWPR script is present and checked, meaning it should be active (it's also set as to run first). Looking at the Error Console only showed a few CSS issues which are present in regular LW pages too. No idea what else could be going on.

FF 4.0.1 portable with addons auto-update, Windows 7 x64, all potentially troublesome addons disabled (ABP, NoScript, RequestPolicy).

Replies from: Tyrrell_McAllister
comment by Tyrrell_McAllister · 2011-05-29T01:11:49.833Z · LW(p) · GW(p)

The script worked for me after I followed this procedure. I would be curious to know whether it works for you. It's still not clear to me just what was wrong.

Replies from: NihilCredo
comment by NihilCredo · 2011-05-29T02:57:48.307Z · LW(p) · GW(p)

Worked for me too, thanks!

comment by Tyrrell_McAllister · 2011-05-26T16:25:37.662Z · LW(p) · GW(p)

Okay, thanks for your help. I'll try the troubleshooting page that you gave.