Skip to content

Instantly share code, notes, and snippets.

@phoenixxie0
Created May 13, 2013 16:00
Show Gist options
  • Save phoenixxie0/5569407 to your computer and use it in GitHub Desktop.
Save phoenixxie0/5569407 to your computer and use it in GitHub Desktop.
python查看APPID剩余流量
# -*- coding: utf-8 -*-
import urllib
import re
d = 1000 #这里1000改成你的APPID的数目
#url = 'http://www.baidu.com'
url = 'http://wwqgtxxproxy-1.appspot.com/2'
html = urllib.urlopen(url).read()
m = re.search(r'<title>(.*)</title>', html, flags=re.I)
#print m.group(1)#or ''
i = m.group(1)
if (i == '503 Over Quota'):
d =d-1
print d #d为剩下的流量
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment