Scroll

Visit
❮   all Projects

AVP Scores

 

What is this app?

As someone interested in AVP beach volleyball, It's a way to stay informed on how a tournament is progressing without having to constantly check in on the avp website throughout the weekend. By polling the official AVP API, results can be delivered in real time to a users cell phone via the free Telegram app. embedded links to the live avp bracket as well as the network broadcast make the app a convenient touch point for all live AVP content.
Coded entirely in python and built for Twilio updates, the original version of the application required a python/flask interface to handle user onboarding and a Postgres database to store user information. Migrating to Telegrams powerful bot API removed the need for a client server and user database store. Telegram messanger allows this service to be completely free of charge and easy to implement rich interactive features in the future.
Telegram users opt in/out with native Telegram user ID. opt-in users and tournament state are stored in a postgres database. When matches are discovered to be be finished, Tournament information is parsed into a result message and sent to each user. when users opt-out, their they are removed from the database completely.

poll_and_merge cycle diagram

Tech used

AVP Scores is a flask server application written in python with a Postgres database, Client side is handled via Telegram messenger via the Telegram bot API

Polling is handled by Advanced Python Scheduler. Match data is polled from the AVP API. Message deliver and onboarding are handled with Telegram Bot API

Routes were tested with Postman.

Twilio & Sendgrid integrations were removed from project.

avp scores menu example image

Build Dependencies

requirements.txt :

amqp==2.6.1
appnope==0.1.0
APScheduler==3.6.3
backcall==0.1.0
bcrypt==3.1.4
beautifulsoup4==4.9.1
billiard==3.6.3.0
blinker==1.4
certifi==2020.6.20
cffi==1.11.5
chardet==3.0.4
Click==7.0
decorator==4.3.0
Faker==0.9.1
Flask==1.0.2
Flask-Bcrypt==0.7.1
Flask-DebugToolbar==0.10.1
Flask-Markdown==0.3
Flask-SQLAlchemy==2.3.2
Flask-WTF==0.14.2
gunicorn==20.0.4
idna==2.10
importlib-metadata==1.7.0
infinity==1.5
intervals==0.9.0
ipython==7.0.1
ipython-genutils==0.2.0
itsdangerous==0.24
jedi==0.13.1
Jinja2==2.10
kombu==4.6.11
Markdown==3.2.2
MarkupSafe==1.1.1
parso==0.3.1
pexpect==4.6.0
phonenumbers==8.12.9
pickleshare==0.7.5
polling2==0.4.5
prompt-toolkit==2.0.5
psycopg2-binary==2.8.4
ptyprocess==0.6.0
pycparser==2.19
Pygments==2.2.0
pyTelegramBotAPI==3.8.3
python-dateutil==2.7.3
python-dotenv==0.14.0
python-http-client==3.3.1
pytz==2020.1
requests==2.24.0
sendgrid==6.4.6
simplegeneric==0.8.1
six==1.11.0
soupsieve==2.0.1
SQLAlchemy==1.2.12
SQLAlchemy-Utils==0.36.8
starkbank-ecdsa==1.0.0
text-unidecode==1.2
traitlets==4.3.2
tzlocal==2.1
urllib3==1.25.10
validators==0.18.0
vine==1.3.0
wcwidth==0.1.7
Werkzeug==0.14.1
WTForms==2.2.1
WTForms-Alchemy==0.17.0
WTForms-Components==0.10.4
xmltodict==0.12.0
zipp==3.1.0

More Details

The application relies on 4 unique polling functions during operation.

  1. weekly_poll(): This polls the AVP API weekly to see if tournament matches have been scheduled for the next event.
  2. in_progress_poll(): This increases the polling to a high frequency when a tournament is discovered to be in progress.
  3. heroku_poll(): This pings the heroku server and prevents it from sleeping during the season
  4. start_pulse(): This sends a message to telegram admin letting them know that the server is still running.
❮   all Projectspicture of Brett

Brett Olson

Full Stack developer Interested in API integrations and solutions engineering

//scroll to section on load