Giter Club home page Giter Club logo

luisfelipesdn12 / alerta-de-campeonatos-wca Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 2.6 MB

Um script que manda um e-mail quando há um campeonato novo na WCA. A script which send an e-mail when there's a new WCA competition. Integrates the WCA's and the Google Sheets API, the subscription is made by the Google Forms.

License: GNU General Public License v3.0

Go 93.49% HTML 6.00% Shell 0.52%
wca go sheets google-sheets forms alert rubiks-cube competitions

alerta-de-campeonatos-wca's Introduction

Alerta-de-Campeonatos-WCA

Um script que manda um e-mail quando há um campeonato novo na WCA. A script which send an e-mail when there's a new WCA competition. Integrates the WCA's and the Google Sheets API, the subscription is made by the Google Forms.

Header

Run - checking for new competitions GoDoc GoReportCard License CodeFactor

Ideia:

"The World Cube Association governs competitions for mechanical puzzles that are operated by twisting groups of pieces, commonly known as 'twisty puzzles'. The most famous of these puzzles is the Rubik's Cube, invented by professor Rubik from Hungary. A selection of these puzzles are chosen as official events of the WCA. As the WCA has evolved over the past decade, over 100,000 people have competed in our competitions."

Me and my friends have the speedcubing as a hobbie, simplified: solve rubik's cube and other puzzles in the lowest time as possible. There's official competitions all over the world, realized by the World Cube Association (WCA), as above-mentioned.

We participate in them, and is very common we check the WCA's site searching for nearly competitions. Sometimes, we check few times a week, and nothing; sometimes, we forgot to check and lost a long-awaited competition. To solve this issue, I had the idea of making a script that would check the site periodically and notify us when it identified a competition nearby that could be of interest to us.

Usage:

Subscribe, inserting your name, email, language and the city you want to be notified by filling the form bellow:

Subscribscription Form

Execution:

To execute this project, I've initially used Python with the libraries requests and BeautifulSoup for web scrapping in the site itself and smtplib for sending emails. But I made a migration to Golang, with the WCA's API instead of the front-end site. I studied modulation of code in local packages, the usage of libraries as spreadsheet for connect with Google Sheets API and the gomail to send the notifications.

The code works as follows:

  • Fetch the data from a spreadsheet in my Google account (recipients data and credentials to emails sending);
  • Verify the upcoming competitions of each recipient city;
  • Update it in the spreadsheet;
  • Compare the current verification with the last one;
  • Send an email if this numbers are different;

All this process is logged in main.log file.

In my Google account, the spreadsheet is organized in this format:

Sheet 1 ("Recipients"):

The data provided by the form and the past verifications.

Form was filled in Name Email City Language Upcoming Competitions Last Verification
00/00/0000 00:00:00 anne [email protected] New Jersey English 7 0000-00-00 00:00:00
... ... ... ... ... ... ...

Sheet 2 ("Betas"):

My personal friends who agreed to be beta testers. When the code is in development it runs here first.

- Name Email City Language Upcoming Competitions Last Verification
- tagu [email protected] São Paulo Português 2 0000-00-00 00:00:00
... ... ... ... ... ... ...

Sheet 3 ("Credentials"):

The email and password of the email sender account.

Email Password
[email protected] my9a55w0rd

To do:

  • Add an runtime map with {city : upcoming copetitions} and if the city were already verificated in other recipient, do not verificate again and catch this data from the map.
  • Add tests in the whole app.

Suggest something to do in issues :)

LICENSE:

Alerta-deCampeonatos-WCA - A script which send an e-mail when there's a new WCA competition. 
Copyright (C) 2020  Luis Felipe Santos do Nascimento

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

alerta-de-campeonatos-wca's People

Contributors

deepsourcebot avatar luisfelipesdn12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

alerta-de-campeonatos-wca's Issues

Aprimoramentos

  • Melhorar a aparência dos e-mails
    • Desenvolver um design HTML para e-mails.
    • Implementar no código.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.