It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
Splatsch: This appears to have been the problem : I installed a too recent version ! (v3.4.3)
I've been a bit lazy there. I'll look into making it version agnostic between 2 and 3.

avatar
Splatsch: Is it possible to have an alarm simply for each time a "new" game is on sale ? (I mean a game is remplacing the one which was actually on sale)
Not at this point in time. I considered going for that in my initial implementation and figured that the script would poll me too often, but this is coming from someone who is interested in less than 10% of the promos.

I'll implement it.

avatar
Splatsch: I launched it (double click seems ok) and now, I have a black window opened (with a blinking cursor) : is this the script correctly running ? (I made a screenshot)

Thanks a lot for the help you all, that's very kind :)
It is silently doing its thing until something goes wrong. I'll add basic feedback.

Atm, if you want to make sure its running properly, add the title of a game currently on promo to the list. That's how I test it.

avatar
Splatsch: And more general question : the script closes each time it detects something ?
Yes. With the current implementation, you want it to, because it opens up a youtube alarm video in a browser tab when it notices a game you are looking for after polling GOG's server (every 10 seconds).

You don't want it to repeatedly open up the alarm in a browser tab each time it polls the server after the initial detection ;). In fact, you probably want to remove that game from the list if you bought it and then re-launch the script.
Post edited March 03, 2015 by Magnitus
avatar
Splatsch: This appears to have been the problem : I installed a too recent version ! (v3.4.3)
avatar
Magnitus: I've been a bit lazy there. I'll look into making it version agnostic between 2 and 3.
Not really a problem for me, it's just that you've to know it before choosing which version of python to install ;) (I thought newer version of python could launch an older version's script)

avatar
Splatsch: Is it possible to have an alarm simply for each time a "new" game is on sale ? (I mean a game is remplacing the one which was actually on sale)
avatar
Magnitus: Not at this point in time. ..
I'll implement it.
Woaow, cool ! It will be useful ! :D
But please, don't do this especially for me now !
For this sale, you script will be enough and will help me to not miss the "most awaited ones" and it will be sufficient !

avatar
Splatsch: I launched it (double click seems ok) and now, I have a black window opened (with a blinking cursor) : is this the script correctly running ? (I made a screenshot)

Thanks a lot for the help you all, that's very kind :)
avatar
Magnitus: It is silently doing its thing. I'll add basic feedback.
Good idea for people like me :) Thanks for thinking about implementing this kind of things !

avatar
Magnitus: Atm, if you want to make sure its running properly, add the title of a game currently on promo to the list. That's how I test it.
That answers all my questions ! Thanks a lot sir ! Now I'm fully ready to use your script :)
Post edited March 03, 2015 by Splatsch
avatar
Splatsch: That answers all my questions ! Thanks a lot sir ! Now I'm fully ready to use your script :)
Glad my script can be of use.

I added the option to have greater verbosity. You just need to set VERBAL to True.

While I know it won't affect you personally at this point, writing scripts that run in an interoperable way between Python 2.7 and 3.x is something that is important for me, so I'll get down to implementing that. There's a module that I use in my script which no longer exists in 3.x so I'll look at alternatives.

For supporting the alarm sounding at every promo change, that will require a bit of restructuring, but its on the pipeline.
Ouch.. I've installed v3 too (+_+)
Post edited March 03, 2015 by phaolo
avatar
Splatsch: That answers all my questions ! Thanks a lot sir ! Now I'm fully ready to use your script :)
avatar
Magnitus: Glad my script can be of use.
Yes it is and will be :) Thank you a lot for it ! It will help me to concentrate on things I want when I'll have (or want) to !

avatar
Magnitus: I added the option to have greater verbosity. You just need to set VERBAL to True.
Okay, thanks ! It's working great.

avatar
Magnitus: While I know it won't affect you personally at this point, writing scripts that run in an interoperable way between Python 2.7 and 3.x is something that is important for me, so I'll get down to implementing that. There's a module that I use in my script which no longer exists in 3.x so I'll look at alternatives.
I understand that this kind of "details" is concerning when you program something, I hope you'll solve this easily.

avatar
Magnitus: For supporting the alarm sounding at every promo change, that will require a bit of restructuring, but its on the pipeline.
That's great ! :D

Again, thanks a lot for the script, and for your modifications and plans ! (and help) :)
Post edited March 03, 2015 by Splatsch
avatar
Magnitus: While I know it won't affect you personally at this point, writing scripts that run in an interoperable way between Python 2.7 and 3.x is something that is important for me, so I'll get down to implementing that. There's a module that I use in my script which no longer exists in 3.x so I'll look at alternatives.

For supporting the alarm sounding at every promo change, that will require a bit of restructuring, but its on the pipeline.
I tried your code and it worked quite well. If I had to guess, I'd say you are trained in Java. :-)

Based on what I learned from studying your work, I made my own script for Python 3.x. It does indeed popup a little notification when a new game is offered. Once I figured where you got your data from, the rest was easy.

If someone wants it, I can make this code available, with the following caveat:

_ a) I did consider Python 2 compatibility when writing it. Yet, I believe it would be simple to make it run on 2.7. And

_ b) I'm currently using the notification system of my KDE (on GNU/Linux). It should be trivial to run some program to play an audio file or something similar, and I will leave that to your taste.
Thanks a lot for sharing this script, Magnitus, it's awesome! :)
avatar
Gede: I tried your code and it worked quite well. If I had to guess, I'd say you are trained in Java. :-)
Originally, C/C++. Then I did a whole mismatch of languages in university and during work terms (including Java).

Then, I mostly worked in C++/Python for a while and now, I mostly work in Javascript with Python/C++ being my backup languages for doing background tasks that Javascript is less well suited for.

One of the big avantages to working with Javascript at this point when doing web development is that you have one language for both the client and the server so you can avoid doing a mental context-switch when working between the two.

avatar
Gede: Based on what I learned from studying your work, I made my own script for Python 3.x. It does indeed popup a little notification when a new game is offered. Once I figured where you got your data from, the rest was easy.

If someone wants it, I can make this code available, with the following caveat:

_ a) I did consider Python 2 compatibility when writing it. Yet, I believe it would be simple to make it run on 2.7. And

_ b) I'm currently using the notification system of my KDE (on GNU/Linux). It should be trivial to run some program to play an audio file or something similar, and I will leave that to your taste.
Sure, I'd love to take a look. Obviously, I'd have to make sure things work with both version of Python (I believe 2.7 is still the most popular default-installed one in many Linux distros at this point) and for Windows/Mac/Linux.

I guess part of the reason I made it open a browser tab pointing to a Youtube video is so that I wouldn't have to ship it with a sound file and worry about copyrights and also it's pretty portable and easy to modify.
Post edited March 03, 2015 by Magnitus
Implemented Python 3 support, so it shouldn't matter anymore whether you download Python 2.7 or 3.4 :).
Post edited March 03, 2015 by Magnitus
avatar
Magnitus: Implemented Python 3 support, so it shouldn't matter anymore whether you download Python 2.7 or 3.4 :).
Nice!
How about the option to get a notification for every new deal like Splatsch suggested? Would that be easy to add?
avatar
Pardinuz: Nice!
How about the option to get a notification for every new deal like Splatsch suggested? Would that be easy to add?
Not hard, but not short. I'll have to re-implement many parts of the script to get that functionality so I can't just change a handful of lines.

I'll be busy for the remainder of the day, but I'll look at implementing it late tonight or early tomorrow morning.
Post edited March 03, 2015 by Magnitus
avatar
Magnitus: Not hard, but not short. I'll have to re-implement many parts of the script to get that functionality so I can't just change a handful of lines.

I'll be busy for the remainder of the day, but I'll look at implementing it late tonight or early tomorrow morning.
That would be great! Thanks. :)
avatar
Magnitus: One of the big avantages to working with Javascript at this point when doing web development is that you have one language for both the client and the server so you can avoid doing a mental context-switch when working between the two.

Sure, I'd love to take a look. Obviously, I'd have to make sure things work with both version of Python (I believe 2.7 is still the most popular default-installed one in many Linux distros at this point) and for Windows/Mac/Linux.

I guess part of the reason I made it open a browser tab pointing to a Youtube video is so that I wouldn't have to ship it with a sound file and worry about copyrights and also it's pretty portable and easy to modify.
Now that Javascript is much faster than it used to be, it makes sense. Yet, I have not learned it yet.

Here is something I wanted to ask you: how on Earth did you discover that URL to fetch the promo data? I would never have found it! I looked for it in the source code of the front page and I could see no hint of its presence!

I'll try to polish it a little bit, see what is easy to port to Python 2 style and try to get it uploaded in about two hours.
I already managed to fetch a couple of games thanks to it. :-)
Thank you for your help!
I have created a forked version of the script to read patterns from files for easier editing. Just edit patterns in patterns.txt file.

https://github.com/phoeniixz/GOG-Flash-Promo-Script
Thanks for doing this!