A Python script deployed to Heroku that performs automatic logins on stackoverflow.com on a regular basis, so that you can earn the Fanatic badge, effortlessly.
Visit the site each day for 100 consecutive days. (Days are counted in UTC.).
Moreover, you get notified, via email, if the script goes wrong and you haven’t logged into Stack Overflow for at least twelve hours.
You may follow the step-by-step guide here.
And the second part, with additional improvements, here.
Alternatively, you can follow the (less detailed) quick start below.
Make sure you have the following dependencies:
Python 3.6+ (along with pip)
Chrome installed (or another browser of choice, though you will have to edit the script)
Python packages (use
pip install to get):
env_vars.txt to include your email, password, and display name (and remove
# to comment out the lines).
source env_vars.txt and then
python3 stack_overflow_page.py to see the script work.
If you want to be notified by email when things go wrong, sign up for sendgrid to get an API key, and add that to
env_vars.txt as well. This can take some work to set up successfully.
To schedule the script on Heroku, sign up for an account on Heroku and follow the instructions in the full step-by-step guide on Medium. Or press the Deploy to Heroku button below.
Once deployed, set the following Config Vars in Heroku app Settings:
Mandatory (basic login script variables):
The script can trigger a CAPTCHA from StackOverflow. A human has to resolve this.
StackOverflow sometimes changes their UI, so that the old CSS identifiers don't match anymore. This can cause one of lines in
stack_overflow_page.py starting with
driver.find_element_by_ to fail. To debug this in Chrome, look for the correct identifier to use instead using the "inspect element" feature in developer tools (Ctrl+Shift+C).
Emails sent by sendgrid can go to spam. If you get errors when sending mail with sendgrid, make sure that you have an account which includes an API key, a verified email address, and that you have set up a verified sender to send mail. Note that sendgrid requires the dependency