-
Today I wrote a greasemonkey script that remembers the last time you visited the forum main page and will highlight any topics that have new posts since that time. It's very basic at them moment, it doesn't highlight the new posts themselves, only the topic rows on the forum main page. Also note that if you reload the page, the highlights will vanish since the "last visited" time will be the current time. I suggest opening all highlighted topics in new tabs so you don't have to reload the main page. It works in Firefox/Greasemonkey, I haven't tested Opera yet, but Chrome doesn't seem to like it.
http://autofocus.cc/public/data/greasemonkey/markforster.net_highlight_new_posts.user.jsI also updated my "always go to the last page of a topic" script so that not only it goes to the last page, it also scrolls down to the bottom, like if you pressed the end key.
http://autofocus.cc/public/data/greasemonkey/markforsternet_forum_sho.user.js 8 February 2010 at 21:49 | Andreas Hofmann
-
Okay, it seems to be working in Chrome now. I had to uninstall and reinstall it, there seems to have been a server error while downloading it. So if it doesn't work for you, try that.
8 February 2010 at 21:59 | Andreas Hofmann
-
Nice code. How does one run it?
8 February 2010 at 22:16 | Alan Baljeu
-
Andreas-- you are a genius! This is very useful and works perfectly for me on Chrome.
Alan if you use Chrome, clicking on the link and allowing it to install was all that was necessary for me.
8 February 2010 at 22:19 | vegheadjones
-
Alan: For firefox, install the Greasemonkey extension, then click the link. In Chrome 4.x, click the link. In Opera, you have to set a userscript directory in the preferences, then right-click the link and save the file in that directory.
8 February 2010 at 22:22 | Andreas Hofmann
-
vegheadjones: It works in Chrome, but it behaves slightly differently than in Firefox, at least on my PC. In Firefox, if I load the forum page, it shows shows updated topics highlighted. Chrome does that too. But if I reload the page in Firefox, the highlighting disappears, because the topics aren't "new" anymore. In Chrome, the highlighting stays upon reloading. But when real new topics show up, Chrome updates too. Do you experience the same or is just me?
8 February 2010 at 22:28 | Andreas Hofmann
-
No highlight upon reloading...
8 February 2010 at 22:29 | vegheadjones
-
Interesting ... oh well, I'll figure it out. May a reinstall of chrome is in order. If I may ask, which version of Chrome do you use? Mine is 4.0.249.78 beta (36714).
8 February 2010 at 22:31 | Andreas Hofmann
-
I located the problem, but it's really strange. For some reason my Chrome always returns 1 as the value of a cookie I set, even though I see the value is different in the cookie data. Luckily, that value was redundant (if was the last number of replies, which isn't necessary since the date changes anyways with new replies), so I modified the script to work without it. And now it works in my Chrome, too. Whatever. ;-)
8 February 2010 at 22:41 | Andreas Hofmann
-
Sorry Andreas, you're no longer speaking my language :)
8 February 2010 at 22:44 | vegheadjones
-
Sorry. ^^
And it broke again. Now the time doesn't update anymore. But only in my Chrome build. Firefox works just as intended. I really don't know. Yours still working fine? What is your version number?
8 February 2010 at 22:46 | Andreas Hofmann
-
Chrome? 5.0.317.2 I think it's working. I'll try again after more time has past and more posts have been made.
8 February 2010 at 22:57 | vegheadjones
-
Oh, you're using the dev build. It should be working. I found the problem, my Chrome saved two sets of cookies and always retrieved the older ones. Don't know exactly why. But I think I fixed it. If you run into any trouble, uninstall the script in your extensions menu and click on the link again, I've updated it.
8 February 2010 at 23:01 | Andreas Hofmann
-
Okay ... there were three bugs in the original script, I highly recommend reinstalling it!
The bugs:
1: A problem with duplicated cookies with different paths, lead to permanent highlighting in some cases.
2: I made a mistake when parsing the date in the the "last reply" column, lead to the script only working PM. :-P
3: Tonight a spam topic was posted, which contained the usual strange characters (Cyrillic letters and such). This lead to no highlighting of this topic and all new topics after it.
These are all solved in the current version that can still be downloaded with the link in the first post.
9 February 2010 at 8:09 | Andreas Hofmann
-
Andreas,
Thank you!
This might not save me quite as much time as DWM does, but it does save me a lot of time.
I tried that program that was mentioned a while back, and I had to uninstall it. But your script worked like a charm.
9 February 2010 at 19:33 | moises
-
I still don't get why it works perfectly in Firefox and Chrome is behaving strangely. Currently, I always get exactly one topic highlighted in Chrome, even if there are more that should be. Firefox highlights them all correctly. I'll figure it out eventually.
9 February 2010 at 19:47 | Andreas Hofmann
-
Dare I ask if this works with IE?
9 February 2010 at 19:58 | Lillian
-
Andreas I get the same result
9 February 2010 at 20:20 | vegheadjones
-
Andreas,
I just installed this now. This is excellent! Thanks! I had been keeping track of the date/time of my last visit in my recurring "AF Forums" task, but this is a lot easier, especially with the script to auto-scroll to the bottom on the last page.
Would it also be possible in a future version to highlight the new posts themselves (when you open up each thread in a new tab)? That would prevent having to re-read a bunch of posts trying to figure out where you left off last.
Maybe that wouldn't be possible/worth implementing though, since it wouldn't be enough to just go by "last visit" time...some posts can come in while you're reading tabs of other threads, and you would miss these entries the next time you came to the page. I guess that's what SiteDelta is for. I could never get that working quite correctly for me, so I uninstalled it. Maybe I'll re-install it for just this purpose...
9 February 2010 at 20:36 | Daniel M
-
Lillian:
I wouldn't bet on it. There are several methods to use greasemonkey scripts with IE, but none of them is 100% compatible. I tried Trixie, but it didn't work. There's also "Greasemonkey for IE" and Turnabout Advanced, but the I haven't figured out how to use the former and the website of the latter seems to be down.
Daniel M:
That would be the next logical step and I already have an idea how to implement it. But before I make the script more complicated, I want to figure out why it doesn't work correctly in Chrome.
9 February 2010 at 20:48 | Andreas Hofmann
-
I found the problem with Chrome (and Opera), I had to change the loops to have it work. I've updated the link yet again, it should now work correctly in Firefox, Opera and Chrome (and Safari,I guess, but I didn't test it yet).
9 February 2010 at 21:55 | Andreas Hofmann
-
I modified the script in the first post once more. It now saves two timestamps instead of one: The time of the last change, and the the time of the *previous* last change. :-)
This is necessary for the following script to work:
http://autofocus.cc/public/data/greasemonkey/markforsternet_highlight_unread_posts.user.jsThis one takes the previous last change time and highlights all posts in the thread view that are newer. Plus it scrolls to the first new post. Neato.
Remember, first uninstall the first script in this thread and reinstall it, then install the second highlight script. It should start working after the first updated topic is reported by the first script.
9 February 2010 at 23:35 | Andreas Hofmann
-
Andreas,
You are awesome!
9 February 2010 at 23:37 | Daniel M
-
A little easter egg: If you edit the script, one of the first commands is "var highlight_mark = 0;". If you change it to "var highlight_mark = 1;", Mark's posts will be highlighted green, everyone else's yellow. ;-)
9 February 2010 at 23:40 | Andreas Hofmann
-
Right now the script is still limited in that when you load the forum main page and the topics get highlighted, as soon as you navigate away from that page, you loose the highlighting. So the best procedure for now is: 1. Open main page, topics get highlighted. 2. Open each highlighted topic in a new tab (Ctrl+Click in most browsers). 3. Read each topic in its seperate thread and close it. 4. Refresh main page and repeat.
Eventually, I'll modify the script to remember which topics where read when, so it can maintain the highlighting as long as you didn't click on the topic. But I think this will do for now. ^^
9 February 2010 at 23:50 | Andreas Hofmann
-
Since the "last updated" timestamp only changes when something really was changed, the last highlight will "linger" until it is replaced with the new one. I could make it so that it disappears if the main page is loaded with no changes, but that would mean that if you load the page twice by accident you lose all the highlighted posts. I think I'll wait for the thread-by-thread-update to address this issue.
9 February 2010 at 23:57 | Andreas Hofmann
-
I don't suppose it's possible to have the script open any post links in a new tab/window? It's easy to forget to Ctrl-click. These are great scripts that make up for the basic SquareSpace forum "features."
10 February 2010 at 15:07 | Brian
-
10 February 2010 at 16:11 | Andreas Hofmann
-
10 February 2010 at 16:36 | Brian
-
Andreas,
How do you uninstall the script in Chrome?
10 February 2010 at 20:20 | Will
-
Got it: spanner>extensions...
10 February 2010 at 20:26 | Will
-
The new versions are working great Andreas-- now if only it would indicate when there are new comments on Mark's blog posts... :)
10 February 2010 at 20:51 | vegheadjones
-
vegheadjones:
<<now if only it would indicate when there are new comments on Mark's blog posts>>
That's a feature this homepage actually already has. In the right sidebar, there is a box called "feeds", and one of the feeds is "Blog Comments RSS".
10 February 2010 at 21:52 | Andreas Hofmann
-
Andreas,
I'm seeing the updated topics in yellow. When I select one, I see the new posts in yellow. When I return to the topic list the yellow is gone. Did I fail to install something or do it in the wrong order.
A suggestion: Maybe you could copy the list of links in the order they need to be installed every time you update them. I was confused about what to update and what sequence to install things in. (and that probably caused this problem.) I would probably, just to be safe, uninstall everything before reinstalling in the order you specify.
I LOVE your scripts. Very nice. And very much faster than poking around. ;-)
11 February 2010 at 12:54 | Mike
-
Two other things:
1) I was unclear. I had in mind copying the entire list of script links to the bottom of any post that notifies us of a change.
2) New behavior. When I made that last post and hit "create", it turned yellow, as expected. But when I went BACK to the LIST of topics, this time this topic was in yellow. It is the first time I have seen yellow when going BACK to the list of topics. Interesting.
11 February 2010 at 12:57 | Mike
-
Mike:
<<I'm seeing the updated topics in yellow. When I select one, I see the new posts in yellow. When I return to the topic list the yellow is gone. Did I fail to install something or do it in the wrong order.>>
No, that's how it works right now due to how the script works, as I described above, and the reason for changing one of the scripts to open each thread in a new tab/window.
There really isn't a right order for installing the scripts. You either have them or don't. I'll reorganize these scripts soon and then update the instructions properly.
So far, there are four scripts in this thread:
1.
The first script highlights the topics that have changed since the last visit on the forum main page:
http://autofocus.cc/public/data/greasemonkey/markforster.net_highlight_new_posts.user.jsSince it is time based, once you get the highlights, the "last visit" date is set to the current time", that's why the highlights aren't there when you go back - the "last visit" has changed and there weren't new posts in the meantime. (That's also why you get a highlight if you posted yourself), because it notices your post as new since your last visit to the main page).
2.
The second script (chronologically the third in this thread) highlights the new posts inside of threads:
http://autofocus.cc/public/data/greasemonkey/markforsternet_highlight_unread_posts.user.jsThis highlighting does not go away if you navigate from the page and return, because it is dependent on the "last changed" date/time saved by the first script. So the highlights will stay until the first script finds new changes and updates the timestamps.
These are the scripts that do the highlighting. The other two scripts are variations of my older "go to the last page of threads" script. You don't need them both, only install one.In fact you don't even have to install one of them, if you want to navigate manually from the first page of each thread.
3.
One alternative is the script that get's you to the last page of a thread and scrolls down to the bottom (if there are no new posts, otherwise the second script scrolls you to the first new post):
http://autofocus.cc/public/data/greasemonkey/markforsternet_lastpage_scrolldown_newtab.user.jshttp://autofocus.cc/public/data/greasemonkey/markforsternet_forum_sho.user.js4.
This is the same as the third script, but additionally it opens each thread in a new tab/window, so you don't have to hold down ctrl or shift (depends on your browser) while clicking to do so manually:
11 February 2010 at 14:08 | Andreas Hofmann
-
Thanks for that clarification, Andreas. It helps.
11 February 2010 at 14:11 | Mike
-
Andreas,
1. Thanks for this great extension.
2. My "back" key no longer works: is this connected in some way? It's quite a high price to pay.
12 February 2010 at 12:00 | Will
-
Will:
Ah, I see. You back key is probably fine. The problem is you installed the version of the "go to last page" script that opens threads in new tabs (script 4 in my previous post). The new tab has no previous page, so the back button doesn't do anything. You can do two things:
1. Uninstall script 4 and install script 3 which doesn't open threads in new tabs. Then you are still in the same tab and can use the back button to go back to the forum main page. But when go back you'll lose the highlighting of new threads for reasons explained above.
2. You can try to get used to having threads open in new tabs. Instead of the back key, you'll have to press Ctrl+W (or Cmd+W on Macs, I guess, not sure) to close the tab with the thread and get back to the tab with the forum main page. In this case you'll keep the highlighted threads until you manually reload the main page.
12 February 2010 at 12:34 | Andreas Hofmann
-
12 February 2010 at 12:57 | Andreas Hofmann
-
Andreas,
In the words of the sage, "Doh".
Silly me. Thanks for the explanation.
12 February 2010 at 20:21 | Will
-
10 March 2010 at 2:22 | Neltkanna