Skip to content

Instantly share code, notes, and snippets.

@sammachin
Created February 10, 2014 10:15
Show Gist options
  • Save sammachin/8913464 to your computer and use it in GitHub Desktop.
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
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