FR Tree Viewer

By George Last update Jun 4, 2009 — Installed 2,312 times.

Script Summary: Transforms Free Republic discussion pages from a flat view to a tree view (replies nested beneath the posts to which they are in reply).



For full usage details, please see the script homepage.

FRTV performs the following enhancements on Free Republic discussion threads:

  • Tree View Transformation
    Normally, the posts in a Free Republic thread are listed in chronological (post number) order. This is the flat view. Replies to a given post are scattered down through the thread. FR provides a View Replies link to check for replies, but it incurs a server delay and, in any case, only shows the first level of replies, not the replies to the replies, etc.
  • FRTV can rearrange a thread's posts such that each one has its replies indented beneath it, and each reply in turn has its replies indented beneath it, etc., in a tree structure. We call this the tree view. By bringing replying posts closer to the post to which they are in reply, the tree view makes it easier to follow the various conversations that develop on a thread.

    FRTV provides a button and a keyboard shortcut to toggle back and forth between the flat view and the tree view.

  • Post Quoting
    Post quoting is simpler function, also designed to make it easier to follow a thread's conversations. FRTV adds a Quote button after the To link in each post having a To link. Pressing the Quote button makes a copy of the post to which the current post is in reply (the object of the To link) and displays it in a shaded box directly above the current post.
  • The To link still works, of course, but you will find the Quote button less disruptive to the browsing experience. The To link sends you to the post; the Quote button brings the post to you. Now, when you come across, e.g., post #216 replying "LOL!" to post #6, you can simply press the Quote button to view the big joke the lazy poster failed to quote.

    Also, if a post mentions another post by number, you see the other post quoted by first selecting the text containing the number before hitting the Quote button.

    The Quote button and the To link are available in both the flat and tree views.

  • The Poster Report
    FRTV can scan a thread and display a statistical report on the contributors to the thread in a popup window. The report lists the contributors and gives some basic statistics about their activity on the thread.
  • Blank Line Removal
    Did you ever notice those extraneous blank lines that crop up at the bottom of some of the posts? Well, FRTV eliminates them!
  • Article Redirect Removal
    FRTV edits the article link at the top of a thread (the one decorated with a circumflex) to go directly to the article instead of detouring through a page that reminds you what you already know, namely that you are leaving the FR site.
FRTV also logs messages showing the time taken by various functions in a blue-shaded area at the very bottom of the page.

Version History

2007-05-01 Initial version.

2007-05-06 Fixed glitch in detecting multipage threads (was getting confused by the word 'first' appearing in keyword link content).

2007-07-31 New feature: If you select a number on the page (by highlighting it with the mouse) before hitting the Quote button, the Quote button quotes the post the number refers to instead of the post to which the current post is in reply. Useful when posters mention other posts by number.

Bug fixes:

  • Changed the page selection criteria to exclude certain pages on which the script is not meant to work.
  • Added a fix that attempts to correct for incorrect page positioning when going to internal anchors (URLs ending with #nnn).

2007-11-04 Added an error message and bailout when XHR receives an error from the server (FR was giving a lot of 502 errors because of a database server problem).

2008-02-03 Fixed a bug in which the Poster Window shows up empty.

Having switched to Mac OS-X, I noticed that the Poster Report was failing to show up. The pop-up window appeared, but it was empty on the Mac. It's apparently a timing issue. Before you put data into the window, you need to give Firefox a breather to ensure it gets the window fully constructed. I inserted a setTimeout with a zero delay after opening the window and before adding the data, and now it's working properly.

2008-04-09 Updated to compensate for a change in the FR reply link format, which was causing replies not to be indexed.

2008-04-10 Applied a style rule, clear:both, to div class a2, an instance of which appears at the bottom of each post. It seems that removing the <br clear="all"> tags, while getting rid of the extra blank lines, causes improper flow in cases where a post contains text floated around a picture. Adding the clear:both rule fixes the problem without adding a blank line.

2008-06-04 Fixed timezone reversion problem. Posting times in downloaded pages are in Pacific time. Site-provided Javascript loops thru them and changes them to local time. However, because the tree viewer uses the original unprocessed HTML, the PDT times were reappearing in rearranged or quoted posts. The tree viewer now edits the time stamps back to local time.

2008-06-22 Fixed a problem with the Poster Report feature, which was caused by Firefox 3. In FF3, the document.evaluate method refuses to process nodes belonging to a different document (in this case, a node belonging to the Poster Report page). Changed it to call the method on the node's ownerDocument.

2009-05-15 Restored operation of the Unquote button under Firefox 3.5. It had relied on storing an object reference in the button object, obtained from the this pointer. But that no longer works, because the object passed to the event handler is now wrapped in an XPCNativeWrapper.

2009-05-24 Moved the script's homepage from googlepages.com to appspot.com, the Google App Engine. Google is phasing out googlepages in favor of an alternative that does not allow arbitrary content to be uploaded.

2009-06-04 Fixed a bug where the Unquote button fails to work in pages that have been converted to / from the tree view. The bug was introduced by the 2009-05-15 fix.