Created
May 13, 2013 16:00
-
-
Save phoenixxie0/5569407 to your computer and use it in GitHub Desktop.
python查看APPID剩余流量
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
# -*- 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