Articles

A more efficient way to waste time on politicalbetting.com (Firefox, Chrome, Safari, maybe others)

In hacking on April 8, 2010 by edmundintokyo

Mike Smithson’s provocative, tightly-written articles at politicalbetting.com attract some very astute and interesting comments.

But the site lacks a few useful features, which makes it quite hard work to follow.

  • There’s no “reply” button, so people address each others’ posts using comment numbers, but the numbers themselves sometimes change when a comment comes out of moderation.
  • The discussion tends to move quite fast, but the only way to get the latest comments is to refresh the page.
  • Some days you don’t have time to read the whole thing, but there are some people you don’t want to miss.
  • Not everybody who posts there is astute and interesting, and there are some people you’d just like to skip.
  • The site only sometimes manages to remember your name and e-mail address, and often loses it.

If, like me, you waste far more time on the site than you should, you might want to try this bookmarklet. To use it, install the bookmarklet in your browser, then browse to the page you want to read and click the link:

  • An “Ignore” link will appear next to each comment. When you click on it, it will hide the text of any comments by the poster you chose to ignore. It stores this information in a cookie in your browser, so it will still be there next time you use the site. Ignored posters get an “Unignore” link next to their names, so you can restore their posts if you change your mind.
  • A “Favourite” link will appear next to the “Ignore” link. Clicking that will highlight that poster’s comments, and create a link above their post to let you jump to the next favourited post.
  • A “Reply” link will appear next to the “Favourite” link. Clicking on it will jump you straight to the comment box, which will contain a link to the comment that you are replying to. If you want to quote some text from the original comment in your reply, you can select the text before clicking “reply”. This is gone now we have Disqus, which already has a reply feature.
  • A “Show more comments” link will appear under the final comment. Clicking that will fetch the latest version of the page behind the scenes and copy all the new comments into the page you’re reading, so you don’t need to refresh.

How to install it

  • Make sure you have the bookmark toolbar showing in Firefox. (You can turn it on via View->Toolbars)
  • Go to this page and drag the “PB Enhanced” link to the bookmark toolbar.
  • If Firefox nags you that the bookmarklet may not be safe, tell it to go ahead anyway.

Update: Megalomaniacs4u has repackaged the bookmarklet as a Greasemonkey script, can install it once in Firefox and you won’t have to click it when you reload the page:

http://megalomaniacs4u.s3.amazonaws.com/political_betting_made_e.user.js

Update: Here’s a Greasemonkey version of the new version, for a Disqus-based comments system. This seems to work on recent versions of Chrome out of the box, with no need to install an additional extension.

Bugs and limitations

  • I’ve only tested it on Firefox. It probably won’t work on other browsers. Apparently it works on Chrome as well. Thanks Chad for checking that out. And Safari.
  • The “reply” button doesn’t always work for some reason.
  • After you post a comment, you’ll have to click the bookmarklet again.
  • If you ignore huge numbers of posters, your cookie will get too big, and something will go wrong.
  • The “Show more comments” feature will show you the comments in the order that it gets them, so a comment that comes out of moderation will appear with the new comments, rather than further up the thread based on the time it was posted. This may make the numbering even more messed up than it already was. Fixed in Disqus version.
  • The bookmarklet may open some kind of obscure security hole where somebody can put special characters in their username and steal your login information or something. It should be OK, but to be on the safe side I wouldn’t suggest using it while logged in as an administrator or moderator. Fixed in Disqus version.
  • Updated I’m not convinced the cookies are carrying across different pages correctly. I’ll see if I can make another version that behaves better tomorrow. Fixed
  • Updated Doesn’t keep the cookie when changing to a different subdomain. Fixed
About these ads

75 Responses to “A more efficient way to waste time on politicalbetting.com (Firefox, Chrome, Safari, maybe others)”

  1. Edmund, you are a God. Thank you very, very much indeed.

    I’d offer to buy you a beer, but you’re in Tokyo!

  2. Excellent stuff. Gabble the Labour minion can now be removed in a jot!

  3. Edmund, Thanks for sharing – an almost revolutionary site improvement!

    I barely noticed “zyklon tim”s last window licking frenzy. Just sailed serenely on while watching his name(only) popup like clicks on the geiger.

    Works a treat!

    —–
    In the Cemetary:

    tim
    gabble
    wage slave – “friend of presidents” , dontchakno
    Jack W
    benM
    disHonest John

    Endangered species list:

    RedRiding
    RodCrosby

  4. Bless you, Edmund, a wonderful piece of work.

  5. Thanks very much for this Edmund, much appreciated.

  6. Edmund

    Great? Thanks a billion.

  7. Edmund,

    Thanks immensely – makes PB even better.

    A bug: the “reply” doesn’t seem to work as described when you select text (Firefox 3.6.2, Windows Vista).

    A couple of “feature requests” – not sure if they are feasible or not. Could you add a “betting post” tick-box near the comment entry area which automatically inserts the code

    <code>* * * BETTING POST * * *</code>

    Highlighting any comment which contains the words “betting post” (perhaps in a different colour/CSS style to the scheme you use to highlight favourite posters) would also be very useful.

  8. Great new favourites feature – but YELLOW? Urgh.

    A silly thing, but can you change the yellow to a more palatable colour?

  9. I like FFCCCC; has the added benefit of not being associated with any political party as far as I know

  10. Yellow would be OK if it was pastel though – FFFFCC

  11. In general, anything which is above “CC” in all of the three is good. I think the brightness is what I objected to, not the actual colour.

  12. OK, ccffff.

  13. Sorry i should have posted my suggestions here.. plae post-it yellow 3rd from top left or first pale blue top left 6th down..

    One other thing, I have to re-click on Chrome after I post but not a big issue fr me if it works for everyone on Firefox.

  14. OK, Fluffy Thoughts has convinced me. It’s now #ffffcc.

    If you want a different one, edit your bookmarklet and substitute the colour you want.

  15. Favourite colour: 255,255,204 [0xFFFFCC]. I’ve used it in commercial products and it’s the closest I can get to Vellum. [I remember WordPerfect 6.0 had something called BarleyCorn - IIRC - which was similarly soothing. Oh dear, showing my age.... :( ]
    :eek: Posted this on your security thread. Please delete that posting. :oops:

  16. Much better – but personally I would go even paler – eeffff or so.

  17. this one 255,255,153
    FFFF99

  18. Sorry Edmund I see you’ve decided, ignore my last ramblings..

  19. The one I just tested is thumbs up! Especially for us insomniacs. Thank you.

  20. In British Standard paint colours that would be a 10 B 15 – ( i.e. pale magnolia ) lol.

  21. I’ve changed mine to eeffff and it is really good

  22. Another stylistic comment – not sure if you agree or not.

    Would <blockquote> be better for quoting parts of previous comments in replies than <i>?

    Not sure about this one – only Stuart Dickson and I seem to use blockquotes regularly.

  23. Didn’t know blockquote worked – sounds like a good idea if it displays in a sensible way.

  24. It does – but it doesn’t nest.

    Then again, neither do italics…

  25. Edmund, that is superb. Many thanks indeed!

  26. Dear Edmond

    This is a great tool. I have blocked some of the more obnoxious ones. However, I do believe that although I prefer to (and have) blocked them, shutting out even obnoxious voices will be detrimental to me, because I will miss out some ligitimate (though miniscule) opinions. But what the heck, I am not a politician, so I will close my ears to them and deprive them of an audience :).

  27. Edmund, just for info, the reply doesn’t carry text with it in Chrome. I’m happy with the way it is as it’s a great addition to the site and iirc Chrome just worked as default.

  28. Edmond in Tokyo, can you do a version that is Mackintosh compatible, particularly for the Safari browser?

    Your application seems Windows compatible only.

  29. Edmund you are a complete and utter legend. I’m going to test this in Safari now, but if not I’ll just keep Firefox open for PB.com throughout the campaign.

    Brilliant work – much appreciated.

  30. Edmund – seems to work fine in Safari as well!!

  31. Hi Edmund, re your latest update and for info, I now get a post id when I use reply on Chrome. No text but at least it identifies who I am replying to. Thanks for all the hard work you’ve done.

  32. Haven’t fixed the reply thing, I’m afraid – I think you just got lucky…

  33. Great widget – but since the last fix, the favourite and ignore have stopped working (all they seem to do is move the post to the top of the screen). Using Firefox 3.6.2.

  34. Hi Edmund,

    Thanks for all your work on this.

    The @replyto thing now works for me (in Chrome) – but not the form ID autofill which worked fine a couple of days ago but now doesn’t.

  35. Update to my last – since clicking “Show more comments” (which worked), it started working but somewhat erratically (sometimes works, sometimes doesn’t – can’t find a consistent reason). Maybe it’s my PC.

  36. Bug: the numbering in replies often seems very strange (can confirm this is not due to moderated posts being released and messing up the numbers, as I saw both examples “live”).

    See for example here

    http://www2.politicalbetting.com/index.php/archives/2010/04/10/saturday-night-open-thread/comment-page-2/#comment-1528955

    and here

    http://www2.politicalbetting.com/index.php/archives/2010/04/10/will-the-electoral-commsion-intervene-to-stop-this/#comment-1528286

  37. Edmund.. your widget is changing the numbering.. see my post 250 on the last thread ( i.e. not the new one )

    Plato @229

    this is a test.. plato’s post is #245 but widget makes it 229

    by Kristin April 11th, 2010 at 10:17 am

  38. Kristin, did you notice when you used it whether the number it showed for the post you were replying to was calling itself 245 or 229?

    AFAIK there are two things going on here:
    1) PB numbering (widget or no widget) gets messed up when posts get held back in moderation then released, causing all the numbers of the post below the moderated one to increase.
    2) The widget pulls in earlier comments that have just got out of moderation at the point where you clicked “More comments”, so the moderated ones get much later numbers than they originally would have had.

    In theory I could fix (2) by putting the comments that came out of moderation in the same places where they would have been if you’d hit “refresh”. But that would mean you’d miss them unless you scrolled back up the thread. And as the numbering is screwed whatever we do and our reply link links back to the original post, that doesn’t feel like it’s worth the trouble…

    Maybe we should just take the post number out of the reply and use the time instead.

  39. I also made a comment yesterday about strange numbering. It is held up in moderation, probably because of the links.

    I agree that using the time instead of numbers would be more sensible, as the internal hyperlinks sort out the “ease of reference problem” elegantly.

  40. OK, got it. The first time you get more comments is OK, but the second time is breaking – it starts counting where it was the first time. Hang on, should be easy to fix.

  41. OK, fixed version is up. Make sure you refresh the page before you grab it so you don’t get the old one again…

    Stuff coming out of moderation will still break as described above, though.

  42. Edmund, is there a limit to the number of commenters one can Favourite? I have a few, and it doesn’t want to take any more, it seems.

  43. The favourites list lives in a cookie, which is about 4000 letters. Assuming 20 letters per cookie including a bit of padding that it needs, that should give you about 200.

    If you haven’t got that may it’s some other problem – could you make sure you’ve got the most recent version of the bookmarklet and see if it still breaks?

  44. Edmund

    I thanked you on PB, now I want to thank you here.

    I use Chrome for all matters to do with news and current affairs, Firefox for private business, opera for hobbies and fun things, and Explorer for watching TV and sport from the US and other places.

    Your widget works perfectly on Chrome and has enhanced my pb experience.

    You are one of the good guys.

  45. EDmund, I know I use Chrome but the select more comments has stopped working for me.

  46. Edmund, just a suggestion, but if it is purely affecting Chrome, perhaps the old version could be made available as a Chrome version ? Thanks.

  47. Also having problems with Chrome and I too would apprrciate having the previous version back, Edmund. Many thanks.

  48. Edmund, I reverted back to FF until you let us know abour the previous version. On the FF one, after you write a post the widget tabs disappear altogether.

  49. Sorry, my bad – I’d put in a feature to tell you when there’s a new thread, which was breaking on Chrome. I’ve taken it out for now, and it seems to be working on Chrome again.

  50. Thanks Edmund, is seems to work same as FF now, in other words the tabs disappear when you post but nae probs I can live happily with that :) Bet you wish you’d never started now! Yay I have my widget back.

  51. Yeah, the tabs have always disappeared when you post. No plans to fix that at the moment.

  52. Fantastic piece of work Edmund; makes a huge difference.

    I have a suggestion for an addition. How about a “Previous favourite” – same as “Next favourite” but going in the other direction? Some of us catch up backwards, as it were! Would make navigating easier anyway.

  53. Hi,

    I’ve greasemonkey’ed your bookmarklet (hate them) and added one small feature, links that go outside the site open in a new tab/window so i can safely click on links with having to remember to press control.

    My version greasemonkey user script is on:
    http://megalomaniacs4u.s3.amazonaws.com/political_betting_made_e.user.js

    I didn’t have to make any major changes to your code, the most radical was prefixing pb_ on the function names to make debugging a bit easier.

  54. Thanks Megalomaniacs4u.

    Not working for me though – sometimes it makes the links and sometimes it doesn’t, but when it does the favourite and ignore are breaking, although “reply” works OK.

  55. Thanks for the feedback – with the absence of tim & gabble I’d not noticed the ignore functionality was broken – i tend not to use the favourites.

    Both should be working now (same url). I missed two calls to refreshlinks when I did the pb_ prefixing… d’oh!

  56. Yup, working for me now. Thanks.

  57. Take that back – the ignore and favourite works OK, but it’s losing the name and e-mail address.

  58. Yes,

    I’ve updated the restoreForm code to reference the field names directly as the script was barfing on referring to frm.author.value where frm was returned by getElementById (possibly another of object access)

  59. Yikes that was incoherent!

    What I meant was the object passed into frm by a document.getElementById(‘commentform’) call wasn’t suitable for direct access to frm.author.value so I thought I’d go directly to document.getElementById(‘author’).value which works unless we end up with multiple ids on the page.

    I really need to take a look via Firebug at what the returned object is and how I get at the child form fields, unfortunately the script doesn’t play nice with firebug…

  60. Either way, it seems to be working now. I’ve updated the main post with a link.

  61. The greasemonkey script has stopped for anyone who has updated to greasemonkey 0.9 in firefox 3.6

    Current discussion on the greasemonkey-users mailing list is pointing towards several unintentional bugs which only appear in firefox 3.6 but not 4.0 so for now downgrading greasemonkey or reverting to the bookmarklet is the best option till I get on top of the bug situation (or a new greasemonkey is released)

  62. The greasemonkey script has been bug fixed to handle the greasemonkey 0.90 issues in Firefox 3.6.13 – grab the latest version:
    http://megalomaniacs4u.s3.amazonaws.com/political_betting_made_e.user.js

  63. Edmund: sorry. I am probably being thick, but how do you install the greasemonkey script? I click on the links and just get a page of script, no download buttons.
    I already have the PB enhanced bookmark, no problems installing it. Works great.Thankyou.

    Started trying to install months ago on firefox 3.6.13 now running 4 beta.

  64. Waster, install the Greasemonkey Firefox extension first:
    https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/

    Then when you click on the link:
    http://megalomaniacs4u.s3.amazonaws.com/political_betting_made_e.user.js
    …it should give you the option to install the Political Betting Made Easier script.

    When you go back to pb.com, the “Favourite”, “Ignore” links etc will appear automatically once the page has loaded.

  65. Edmund: Thanks, it is now installed and working fine.

  66. Update: On Android phones, there doesn’t seem to be an official Greasemonkey, but there’s a thing called Tampermonkey in the Android store which seems to work with Megalomaniacs4u’s version.

  67. I’ve downloaded this on Chrome, but the “PB Enhanced” link doesn’t work for me.

  68. Sorry, got it working now! :D

  69. There seems to be a problem with Safari 5.1.

    Safari 5.1 / Mac OS 10.6.8

    When I click on the PB Enhanced bookmarklet I get the following error message:

    ‘Safari can’t run the script “function setUpLinks()…

    …because Safari doesn’t allow Javascript to be used in that way.’

    Just FYI.

  70. Thanks Dave – I’ll take a look when I get a chance.

  71. A first attempt at a version working with Disqus is now on:

    http://megalomaniacs4u.s3.amazonaws.com/pb_disqusd_user.js

    This restores the comment refresh link & the open links in new tabs. Extra functionality as I get used to the disqus api & the masses of html it produces

  72. OK, I went ahead and did a Greasemonkey version.

    http://www.edochan.com/widgets/pb/pb_disqus_edmund_widget.user.js

    Seems to work in recent versions Chrome out of the box, without needing an extension.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: