-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated project files. Version 0.0.1
- Loading branch information
1 parent
8ccb957
commit 4dbcf34
Showing
6 changed files
with
45 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ RUN pip3 install -r requirements.txt | |
|
||
COPY . . | ||
|
||
CMD [ "python3", "main.py"] | ||
CMD [ "python3", "app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
import crython | ||
import discord | ||
import scraping | ||
from flask import Flask | ||
from time import sleep | ||
|
||
if __name__ == '__main__': | ||
tickets = scraping.get_available_weekend_tickets() | ||
app = Flask(__name__) | ||
|
||
|
||
@app.route("/") | ||
def hello(): | ||
return "F1 ticket bot" | ||
|
||
|
||
@crython.job(second=0) | ||
def ticket_checker_job(): | ||
tickets = scraping.get_available_weekend_tickets() | ||
if len(tickets) != 0: | ||
ticket_names = scraping.get_tickets_name(tickets) | ||
for ticket_name in ticket_names: | ||
discord.send_message("Ticket available: " + ticket_name + " - " + scraping.url) | ||
sleep(1) | ||
else: | ||
print("No tickets available") | ||
print("No ticket available.") | ||
|
||
|
||
if __name__ == "__main__": | ||
discord.send_message("Script started successfully.") | ||
crython.start() | ||
app.run() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
requests~=2.28.2 | ||
bs4~=0.0.1 | ||
beautifulsoup4~=4.12.0 | ||
cron | ||
crython~=0.2.0 | ||
Flask~=2.2.3 | ||
six~=1.16.0 |