Auto-Notification of Comments?

10 posts

Flag Post

Hello there,
I am currently at 19 games and counting. A good portion of those are tutorials, so I try to answer comments (which are often questions) as quickly as possible. Currently the only way I know of to do this is to literally go on each game to check for new comments. So, question:

Does anyone know how to get automatically notified of new comments? Or, does someone know how to do the coding to search through the game pages and email myself when there is a new comment?

Thank you in advance for your help. :)

 
Flag Post

Didn’t you ask for something like this earlier?
Anyway, it’s somewhat impractical since some games get thousands of comments a day.

 
Flag Post

Are you using Windows, Linux, whatever Apple’s OS is, or something else? I know you can set up cron jobs in Linux or you can use Task Scheduler in Windows to set up automated recurring tasks. Then you’d have it run a script to access the page(s) you’d want to check. I’m mucking about a bit with Perl to see how difficult it would be to get something serviceable (but I don’t have Perl installed on my computer any more, and I’m too lazy to re-install it right now just to test the script); maybe I’ll post it after I finish tinkering with it. It won’t be anything spectacular, code-wise (I haven’t done any Perl rogramming in years), but may work. You’d have to test it yourself, though, unless I feel like re-installing Perl…

Addition: OK, nevermind. Use Senekis93’s python code instead.

 
Flag Post

http://pastie.org/4642740

How to use:

  • Save it with PY extension. ie; new_comments.py
  • If you don’t have a Python interpreter, download one: http://www.python.org/getit/
  • Run the file and enjoy.

You can change the line user=raw_input("Enter your Kongregate name.\n\t\t") for something like user="Abigayl", so it automatically browses your games instead of asking you to input your name everytime.

Also, the first time it will tell you that you have new comments in all the games. That’s normal, since the save file doesn’t exist and the program will see all comments as new ones.

And it will store the info in data.txt so make sure that there’s not a file with that name in the folder where you save the PY file or its content will be replaced.

Finally, it’s designed to handle a single user. If you use it with a name and then run it with a different name, it won’t work properly.
This can be avoided by placing copies of the PY file in different directories or temproary renaming the old data.txt file and switching the names of the data files when necessary.

E: Uploaded a new version which runs a bit faster.

Also, don’t edit the data.txt file.
I don’t know what happens, but even if you edit it in a valid format, the thing messes up the application and throws a couple of empty values. I’m guessing it’s some sort of special character or something.</edit>


If anyone knows Python and has some free time, it’d be nice if you could clean this and post an updated version.
Before this, all I’ve done with Python was some super small script/mods, and I bet this code is full of stuff done in the worst possible way.

 
Flag Post

Looks neat. If someone wants to make a version that uses the most recent edition of python, that would be appreciated.

 
Flag Post

Thanks! I will be trying this out shortly :)

 
Flag Post

Blobby, I interpreted (for you do not compile python!) this for 3.2.3. It worked fine.

 
Flag Post
Originally posted by lSWATLLAMA:

Blobby, I interpreted (for you do not compile python!) this for 3.2.3. It worked fine.

Maybe you’re running Python 2.7 and don’t know it? In python 3 for example, print statements must have their arguments in ().
Clearly the above code does not.

 
Flag Post

I used 2.7 and it’s working nicely :). Thank you so much!

 
Flag Post

uploaded a new version (http://pastie.org/4642740) where I fix an issue with the saved file where it was adding an extra line and most important, changed the way in which games are added; I didn’t know that Kong auto sorted them by rating or some other random thing. Now they will be sorted by upload date, so adding new games or having your games change ratings won’t result in errors.
Also, now it saves to youUserName.txt

Let me know if you find any issues.