l19 new post checking for the obsessive compulsive

All non-Go discussions should go here.
Post Reply
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

l19 new post checking for the obsessive compulsive

Post by Kirby »

As many may have noticed, I'm somewhat obsessive about checking new posts on L19. I always want to notice when someone makes a new post, or what's happening on the forum. Most of the time, there aren't that many posts in the day, so I waste a lot of time checking new posts just to see an empty page.

I wrote this short script that will check the site for me:

Code: Select all

<script>
var xhr;
var newestTopic = "";
var different = false;
function reqListener() {
   document.open();
   if (xhr.readyState == XMLHttpRequest.DONE) {
      var doc = new DOMParser().parseFromString(xhr.responseText, "text/html");
      var topics = doc.getElementsByClassName("topictitle");
      var details = doc.getElementsByClassName("topicdetails");      
      var topTopic = topics[0].innerHTML + details[0].innerHTML;
      if (newestTopic != "" && newestTopic != topTopic)
      {
         different = true;
      }
      newestTopic = topTopic;
   }
   
   if (different)
   {
      alert("A new post has been made.");
      window.location.replace("https://lifein19x19.com/search.php?search_id=newposts");
   }
}

function loadPage() {
   xhr = new XMLHttpRequest();
   xhr.addEventListener("load", reqListener);
   xhr.open('GET', 'https://lifein19x19.com/search.php?search_id=newposts', false);
   xhr.send();
}
loadPage();
setInterval(loadPage,5000);
</script>

The idea is, every 5 seconds, it makes a new request to check the new posts page. If it detects a difference in the latest new post, either in post title or reply count, a javascript alert is fired, and the page redirects to L19. The big difference between this and me manually checking is that the javascript alert steals focus, so I can keep the browser minimized and do whatever work I want to do. But whenever there's a new post, the window pops up automatically.

Not really sure if this is helpful to anyone else, but maybe it can help me to calm down a little bit, do more work, and stop checking the site so often (well, at least delegate that to the script).
be immersed
User avatar
Bonobo
Oza
Posts: 2223
Joined: Fri Dec 23, 2011 6:39 pm
Rank: OGS 9k
GD Posts: 0
OGS: trohde
Universal go server handle: trohde
Location: Germany
Has thanked: 8262 times
Been thanked: 924 times
Contact:

Re: l19 new post checking for the obsessive compulsive

Post by Bonobo »

You could simply have written “for Tom aka Bonobo” in the title :-D

So, how do I use it? Is it a bookmarklet?

TIA, Tom
“The only difference between me and a madman is that I’m not mad.” — Salvador Dali ★ Play a slooooow correspondence game with me on OGS? :)
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: l19 new post checking for the obsessive compulsive

Post by Kirby »

Just copy it into a text editor and save it as an html file. Open the file in your browser, and it's just a blank page until someone posts.
be immersed
User avatar
Bonobo
Oza
Posts: 2223
Joined: Fri Dec 23, 2011 6:39 pm
Rank: OGS 9k
GD Posts: 0
OGS: trohde
Universal go server handle: trohde
Location: Germany
Has thanked: 8262 times
Been thanked: 924 times
Contact:

Re: l19 new post checking for the obsessive compulsive

Post by Bonobo »

Thanks, will try it out :-)
“The only difference between me and a madman is that I’m not mad.” — Salvador Dali ★ Play a slooooow correspondence game with me on OGS? :)
User avatar
ez4u
Oza
Posts: 2414
Joined: Wed Feb 23, 2011 10:15 pm
Rank: Jp 6 dan
GD Posts: 0
KGS: ez4u
Location: Tokyo, Japan
Has thanked: 2351 times
Been thanked: 1332 times

Re: l19 new post checking for the obsessive compulsive

Post by ez4u »

LOL, I saw this and misinterpreted the topic. I thought it was about checking for obsessive compulsive behavior among L19 posters somehow. When I looked at K's OP I saw that I was wrong.

However, when I thought carefully, I realized that is still available as a form of self test. Your level of OC behavior can be measured by the numerical value that you put in ...

Code: Select all

setInterval(loadPage,5000)


Luckily L19 probably isn't popular enough that this new device will bring down the server, but who knows! :)
Dave Sigaty
"Short-lived are both the praiser and the praised, and rememberer and the remembered..."
- Marcus Aurelius; Meditations, VIII 21
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: l19 new post checking for the obsessive compulsive

Post by Kirby »

Well, not really a new device - just a bit of JavaScript. But it kept me semi productive today.

Better solution would be to have more self control, but I tried that before and it seems to be a losing battle :blackeye:
be immersed
User avatar
Bonobo
Oza
Posts: 2223
Joined: Fri Dec 23, 2011 6:39 pm
Rank: OGS 9k
GD Posts: 0
OGS: trohde
Universal go server handle: trohde
Location: Germany
Has thanked: 8262 times
Been thanked: 924 times
Contact:

Re: l19 new post checking for the obsessive compulsive

Post by Bonobo »

Didn't seem to work for me, but I think I prefer just having the “unread posts” tab open since I look at most new posts/replies anyway. I could just set a JS to reload it every ten minutes for me so whenever I come back here again I could see the new posts/comments already, but hitting cmd+R every other hour works fine for me actually ;-)

I just wish I could stop the posts in the Malkovich dept. from appearing here … would it be possible to have an “unsubscribe” mechanism for specific sub-forums?
“The only difference between me and a madman is that I’m not mad.” — Salvador Dali ★ Play a slooooow correspondence game with me on OGS? :)
User avatar
pnprog
Lives with ko
Posts: 286
Joined: Thu Oct 20, 2016 7:21 am
Rank: OGS 7 kyu
GD Posts: 0
Has thanked: 94 times
Been thanked: 153 times

Re: l19 new post checking for the obsessive compulsive

Post by pnprog »

Good script! :tmbup:

But, checking every 5 seconds seems too much for me (it's more than 17000 per day :shock: ). I think checking every 60 seconds would be more reasonable.
I am the author of GoReviewPartner, a small software aimed at assisting reviewing a game of Go. Give it a try!
User avatar
FuriousGeorge
Dies in gote
Posts: 39
Joined: Thu Mar 16, 2017 1:51 pm
Rank: OGS 20k
GD Posts: 0
Universal go server handle: FuriousGeorge
Has thanked: 33 times
Been thanked: 8 times

Re: l19 new post checking for the obsessive compulsive

Post by FuriousGeorge »

I'm glad I'm not the only one that keeps impulsively checking for new posts. You all are enabling my addiction by normalizing my behavior! :P
Kirby
Honinbo
Posts: 9553
Joined: Wed Feb 24, 2010 6:04 pm
GD Posts: 0
KGS: Kirby
Tygem: 커비라고해
Has thanked: 1583 times
Been thanked: 1707 times

Re: l19 new post checking for the obsessive compulsive

Post by Kirby »

FuriousGeorge wrote:I'm glad I'm not the only one that keeps impulsively checking for new posts. You all are enabling my addiction by normalizing my behavior! :P


Ideally, I'd like everything to just go to my email inbox. Then I can have one webpage open that has everything that I'm interested in checking. You can setup email notifications or thread alerts, but in my experience, you don't receive email for quite some time after a post has been made.

Maybe it's better to just have more self-control, and have a designated time of the day where you check L19. For example, maybe I could check the site every day at 8:00pm to see what's happened throughout the day...

But what if I missed something interesting, and people... chat about it without me?

That's where the fear kicks in... :-S
be immersed
User avatar
FuriousGeorge
Dies in gote
Posts: 39
Joined: Thu Mar 16, 2017 1:51 pm
Rank: OGS 20k
GD Posts: 0
Universal go server handle: FuriousGeorge
Has thanked: 33 times
Been thanked: 8 times

Re: l19 new post checking for the obsessive compulsive

Post by FuriousGeorge »

I have no clue if this will help, but sometimes when I'm faced with a willpower issue (or a task I don't really care to do) I have to leverage something external to help me check the behavior (only superhumans can get by on willpower alone). Usually I set timers, something like: for the next 30 minutes I can only do X and not Y or Z, and then when the timers up THEN I can do Y or Z (like a reward).

Seems a bit goofy, but often I'll get enough momentum and focus that I'll be able to continue past the timer, and then I don't feel quite as guilty about Y or Z.

I only mention it because I've had to start doing this to myself for Go. For the next however many minutes I can't obsess over Go, either here at L19 or reading material or watching videos or streams. If I don't limit the behavior, I'll find that I have been chasing the Go rabbit for an hour or more without realizing it. :oops:
Post Reply