Last active
May 18, 2016 00:49
-
-
Save bigomega/b37ca34c4b635008215788b0f1cc89cc to your computer and use it in GitHub Desktop.
Revisions
-
bigomega revised this gist
May 18, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ html = urllib2.urlopen('http://www.dota2.com/international/battlepass').read() prizepool = re.search('id=[\'"]prizepool[^>]*>[\n\r\t]*([^<\t\r\n]*)', html, re.IGNORECASE).group(1) print(time.strftime('%H:%M - %m/%d/%Y'), prizepool) print("Update it in Google sheets") json_key = json.load(open(os.path.join(os.path.dirname(__file__), 'Personal hacks-0e20089bab35.json'))) @@ -14,6 +14,6 @@ wks = gc.open_by_key('1wwsNgSWd1mTv9BF1NqHCowjRIGKF8YVFFxLLeQGUUM4').worksheet('Data') # wks = gc.open('Balance Tracker').get_worksheet(0) cell = wks.acell('J1').value wks.update_acell('A' + cell, time.strftime('%H:%M')) wks.update_acell('B' + cell, time.strftime('%m/%d/%Y')) wks.update_acell('C' + cell, prizepool) -
bigomega revised this gist
May 18, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ import urllib2, re, time, json, os import gspread from oauth2client.client import SignedJwtAssertionCredentials -
bigomega revised this gist
May 17, 2016 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ html = urllib2.urlopen('http://www.dota2.com/international/battlepass').read() prizepool = re.search('id=[\'"]prizepool[^>]*>[\n\r\t]*([^<\t\r\n]*)', html, re.IGNORECASE).group(1) print(time.strftime('%H:%M %Z - %m/%d/%Y'), prizepool) print("Update it in Google sheets") json_key = json.load(open(os.path.join(os.path.dirname(__file__), 'Personal hacks-0e20089bab35.json'))) -
bigomega created this gist
May 17, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ import urllib2, re, time import gspread from oauth2client.client import SignedJwtAssertionCredentials html = urllib2.urlopen('http://www.dota2.com/international/battlepass').read() prizepool = re.search('id=[\'"]prizepool[^>]*>[\n\r\t]*([^<\t\r\n]*)', html, re.IGNORECASE).group(1) print("Update it in Google sheets") json_key = json.load(open(os.path.join(os.path.dirname(__file__), 'Personal hacks-0e20089bab35.json'))) scope = ['https://spreadsheets.google.com/feeds'] credentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'].encode(), scope) gc = gspread.authorize(credentials) wks = gc.open_by_key('1wwsNgSWd1mTv9BF1NqHCowjRIGKF8YVFFxLLeQGUUM4').worksheet('Data') # wks = gc.open('Balance Tracker').get_worksheet(0) cell = wks.acell('J1').value wks.update_acell('A' + cell, time.strftime('%H:%M %Z')) wks.update_acell('B' + cell, time.strftime('%m/%d/%Y')) wks.update_acell('C' + cell, prizepool)