It is currently Thu Mar 28, 2024 8:19 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
Offline
 Post subject: l19 new post checking for the obsessive compulsive
Post #1 Posted: Fri May 26, 2017 2:36 pm 
Honinbo

Posts: 9545
Liked others: 1600
Was liked: 1711
KGS: Kirby
Tygem: 커비라고해
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:
<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


This post by Kirby was liked by 2 people: Bonobo, daal
Top
 Profile  
 
Offline
 Post subject: Re: l19 new post checking for the obsessive compulsive
Post #2 Posted: Fri May 26, 2017 4:34 pm 
Oza
User avatar

Posts: 2221
Location: Germany
Liked others: 8262
Was liked: 924
Rank: OGS 9k
OGS: trohde
Universal go server handle: trohde
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? :)

Top
 Profile  
 
Offline
 Post subject: Re: l19 new post checking for the obsessive compulsive
Post #3 Posted: Fri May 26, 2017 4:58 pm 
Honinbo

Posts: 9545
Liked others: 1600
Was liked: 1711
KGS: Kirby
Tygem: 커비라고해
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


This post by Kirby was liked by: Bonobo
Top
 Profile  
 
Offline
 Post subject: Re: l19 new post checking for the obsessive compulsive
Post #4 Posted: Fri May 26, 2017 5:13 pm 
Oza
User avatar

Posts: 2221
Location: Germany
Liked others: 8262
Was liked: 924
Rank: OGS 9k
OGS: trohde
Universal go server handle: trohde
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? :)

Top
 Profile  
 
Offline
 Post subject: Re: l19 new post checking for the obsessive compulsive
Post #5 Posted: Fri May 26, 2017 6:30 pm 
Oza
User avatar

Posts: 2401
Location: Tokyo, Japan
Liked others: 2338
Was liked: 1332
Rank: Jp 6 dan
KGS: 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:
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

Top
 Profile  
 
Offline
 Post subject: Re: l19 new post checking for the obsessive compulsive
Post #6 Posted: Fri May 26, 2017 8:00 pm 
Honinbo

Posts: 9545
Liked others: 1600
Was liked: 1711
KGS: Kirby
Tygem: 커비라고해
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

Top
 Profile  
 
Offline
 Post subject: Re: l19 new post checking for the obsessive compulsive
Post #7 Posted: Sat May 27, 2017 4:08 am 
Oza
User avatar

Posts: 2221
Location: Germany
Liked others: 8262
Was liked: 924
Rank: OGS 9k
OGS: trohde
Universal go server handle: trohde
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? :)

Top
 Profile  
 
Offline
 Post subject: Re: l19 new post checking for the obsessive compulsive
Post #8 Posted: Mon Jun 05, 2017 6:46 am 
Lives with ko
User avatar

Posts: 284
Liked others: 94
Was liked: 153
Rank: OGS 7 kyu
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!

Top
 Profile  
 
Offline
 Post subject: Re: l19 new post checking for the obsessive compulsive
Post #9 Posted: Mon Jun 19, 2017 8:16 am 
Dies in gote
User avatar

Posts: 39
Liked others: 33
Was liked: 8
Rank: OGS 20k
Universal go server handle: 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

Top
 Profile  
 
Offline
 Post subject: Re: l19 new post checking for the obsessive compulsive
Post #10 Posted: Mon Jun 19, 2017 8:54 pm 
Honinbo

Posts: 9545
Liked others: 1600
Was liked: 1711
KGS: Kirby
Tygem: 커비라고해
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

Top
 Profile  
 
Offline
 Post subject: Re: l19 new post checking for the obsessive compulsive
Post #11 Posted: Tue Jun 20, 2017 4:06 am 
Dies in gote
User avatar

Posts: 39
Liked others: 33
Was liked: 8
Rank: OGS 20k
Universal go server handle: 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:

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group