Created
February 10, 2014 10:15
-
-
Save sammachin/8913464 to your computer and use it in GitHub Desktop.
AAISP GET Quota, snippet to get your remaining quota from Andrews & Arnolds 'clueless' server in python, needs requests & beautifulsoup4 modules
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
import requests | |
from bs4 import BeautifulSoup | |
aauser = 'xx99@a' | |
aapass = 'xxxxx' | |
def getQuota(): | |
r = requests.get('https://clueless.aa.net.uk/main.cgi', auth=(aauser, aapass)) | |
soup = BeautifulSoup(r.text) | |
qstring = soup.find_all('table')[1].find('tbody').find_all('td')[5].find('a').string | |
quota = float(quota.rstrip('GB')) | |
return quota |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment