Registration Notification

Subscribe to Registration Notification 16 posts, 3 voices

 
midorocco User

hello!
sorry for my english because I speak french...
I'm looking for a scrpit that can notify me when the torrent website: snowtigers.net open registration.
it's a great torrent website for french people and they open registration 2 or 3 times per year.
I think that it's not very difficult to encode but I can't encode it because I don't know javascript :p.
the registration page is: http://www.snowtigers.net/account-signup.php
Thank you for your help.

 
znerp Scriptwright

Using the title of the page to test whether it is open, you could create the following script which will refresh the page every minute until it changes. If the title changes, a messagebox will appear to let you know. If you leave this running in the background, the browser will start to flash on your taskbar if the title changes.

if (/Erreur: Désolé\.\.\./.test(document.title))
  alert("Registration open!")
else
  window.setTimeout( function(e) { window.location.reload(true) }, 60000 )

 
midorocco User

Thank you znerp for your quick answer... But I don't know how to create the script or how can I add your code to Greasemonkey...
I understand that the code will check the title of the page, and if it changes it means that the registration is open.
It's a good idea but please help me to add it to Greasemonkey.

 
JoeSimmons Scriptwright

You did your script backwards znerp. If it doesn't have Erreur in the title it should alert.
Anyways, I made one.
http://userscripts.org/scripts/show/34716

 
znerp Scriptwright

@JoeSimmons: You're right, I forgot to add a ! in my if condition.

I've had a look at your script though, and I don't think it will work. The reason why I went with document.title (except that it's much easier than using the long XPath you used) is that there's no way of knowing how the page will look when registation is open. If the structure of the page changes and your XPath fails, then an error will pop up on the error console, the page won't refresh, and no alert will show. Also, sort out your includes. As it is it will either flood the error console or refresh some -- admittedly very few -- pages every minute.

@midorocco: Until JoeSimmons updates his script, copy the following into a new text file, name it anything.user.js and then open it with Firefox (assuming you have Greasemonkey installed and enabled). This will install the script ready for you to open the page...

// ==UserScript==
// @name           SnowTigers Registration Alerter
// @include        http://www.snowtigers.net/account-signup.php
// ==/UserScript==

if (!/Erreur: Désolé\.\.\./.test(document.title))
  alert("Registration open!")
else
  window.setTimeout( function(e) { window.location.reload(true) }, 60000 )

 
midorocco User

Wow! Great job...
I added znerp's script to firefox and of course I have greasemonkey on it...
thank you very much znerp and JoeSimmons for your help...

 
midorocco User

After I added it to firefox... it tell me "Registration open!" every time I open the registration page...
I tried to test the script with an other page by modifing his title and it tell me the same message...
What I did is creating a page named "test.html" and I gived it the title "SnowTigers.NeT :: Erreur: Désolé..." and then I changed the title to "SnowTigers.NeT :: test" without refreshing the page and it didn't show me any notification...

 
znerp Scriptwright

@midorocco: Are you sure you used the second piece of code I've pasted, ie. where the first line is...

if (!/Erreur: Désolé\.\.\./.test(document.title))

..with the exclamation point. I've just tested it, and it seems to work fine for me.

 
midorocco User

I don't know... but when I open the page it tell me "registration open!" and it doesn't refresh again...
I copied the entire code (with the exclamation point)... so if the message is normal then it's ok... :D
Thank you again for your help znerp.

 
znerp Scriptwright

Ok, I've found the problem. When saving the text file, the é's get messed up due to the character encoding.

Try it again (you might want to uninstall the current version first), but either change the character encoding of the text file to eg. Unicode (which seems to work for me, whereas ANSI doesn't), or just use the following code..

// ==UserScript==
// @name           SnowTigers Registration Alerter
// @include        http://www.snowtigers.net/account-signup.php
// ==/UserScript==

if (!/Erreur: D.sol.\.\.\./.test(document.title))
  alert("Registration open!")
else
  window.setTimeout( function(e) { window.location.reload(true) }, 60000 )

 
midorocco User

I don't know how to thank you my friend...
It works now and I'm very happy...
Thank you again and again and again....:D

 
midorocco User

hello!
I'm very happy, the script worked for me and now I have an account on Snowtigers...
The script work fine exept when the page doesn't load so it give me the message "Registration open!" but it's not really open and also when they tell me the server is busy...
I know that's because of the title that change so I have a good idea: when I found the registration opened I checked the title of the registration page and it was: <title>SnowTigers.NeT :: Inscription</title>...
So I think that we can change the script to check if the title contain "Inscription" and then notify...
I don't know how to do it ( me be I have to do remove the "!" and change the title ) so I hope that @znerp or an other member can help me...
And again thank you very much.

 
JoeSimmons Scriptwright

Ok midorocco I just fixed the script with what you want.
http://userscripts.org/scripts/show/34716

 
midorocco User

Thank you JoeSimmons for your help...
And I made a modification in znerp's script and I think it will work:

// ==UserScript==
// @name           SnowTigers Registration Alerter
// @include        http://www.snowtigers.net/account-signup.php
// ==/UserScript==

if (/Inscription/.test(document.title))
  alert("Registration open!")
else
  window.setTimeout( function(e) { window.location.reload(true) }, 60000 )

But why did you put an "i" after "/Inscription/"?
Thank you for your help.

 
JoeSimmons Scriptwright

That i means case insensitive. So if it's Inscription or inscription, it will find it.

 
midorocco User

Ok man, thank you :)...