Created
January 18, 2023 16:52
-
-
Save trentwiles/4a8f6ac49b9cd36dd321c49361c048b4 to your computer and use it in GitHub Desktop.
Find out if fran is selling Lux VPSs or not
This file contains hidden or 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
import requests | |
from bs4 import BeautifulSoup | |
from flask import Flask | |
def find(): | |
r = requests.get("https://my.frantech.ca/cart.php?gid=39").text | |
soup = BeautifulSoup(r, 'html.parser') | |
if int(soup.find_all("div", {"class": "package-qty"})[0].text.strip()[0]) > 0: | |
return True | |
else: | |
return False | |
app = Flask(__name__) | |
@app.route('/') | |
def welcome(): | |
if find() == True: | |
return "Available!" | |
else: | |
return "Nothing" | |
if __name__ == '__main__': | |
app.run(host='0.0.0.0', port=5002) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment