Skip to content

Instantly share code, notes, and snippets.

@Noxville
Created August 29, 2015 16:47
Show Gist options
  • Save Noxville/1c436d5c7c3d4bb45836 to your computer and use it in GitHub Desktop.
Save Noxville/1c436d5c7c3d4bb45836 to your computer and use it in GitHub Desktop.
TI5 Replay Votes
#!/usr/bin/python
import sys
import requests
import time
def get_votes(m_id):
if len(sys.argv) <= 1:
print "You need to add an API key as a sys arg"
return
url = "https://api.steampowered.com/IDOTA2Match_570/GetMatchDetails/V001/?match_id={}&key={}".format(m_id, sys.argv[1])
resp = requests.get(url)
if resp.status_code != 200:
print "Can't get match {} - error code {}".format(m_id, resp.status_code)
return resp.json()
with open("ti5_events.txt", 'r') as fin:
matches = [e.strip() for e in fin.readlines()]
print "match_id, positive_votes, negative_votes"
for match in matches:
votes = get_votes(match)
print "{},{},{}".format(match,
votes['result'].get('positive_votes'),
votes['result'].get('negative_votes')
)
time.sleep(1)
match_id positive_votes negative_votes
1666209170 5163 209
1666177296 1550 175
1666148259 6254 748
1666125998 2956 183
1666122929 2569 262
1666088527 9138 308
1666048848 4433 410
1666045478 932 50
1665990348 15406 1111
1665986855 1104 64
1665972746 8708 652
1665829829 16585 606
1665826280 581 59
1665822701 12266 1098
1665700254 34689 813
1665686446 16961 758
1665685543 2293 214
1668556845 1809 152
1668507634 742 51
1668506691 7329 908
1668493996 1153 135
1668437721 9817 1106
1668434795 431 35
1668432255 1452 86
1668345858 4147 230
1668338643 1085 75
1668319630 3167 307
1668245426 1551 125
1668243304 836 65
1668240246 6822 328
1668137863 4598 2210
1668110665 2012 186
1668109169 5631 321
1668012309 2333 221
1667995496 2416 265
1667987887 13316 1559
1666577877 4030 386
1666539842 3678 226
1666460321 9178 572
1666453945 2833 367
1666424868 4836 334
1666372636 663 50
1666366844 2602 200
1666366213 4341 213
1666308348 2874 157
1666286219 2430 154
1666276978 3581 272
1666238587 1809 201
1666185341 6143 1029
1671129267 1434 87
1671123709 1270 78
1671121575 1287 974
1671067751 1373 205
1671063488 1277 89
1670993670 3146 1075
1670974602 2561 114
1670963917 5495 1076
1670901885 395 29
1670865252 3877 184
1670863093 8143 1297
1670808701 1865 148
1670707254 8274 435
1670702068 10665 1012
1670686522 3606 1020
1670611989 7849 433
1670594877 2505 1148
1670592135 10131 536
1668862986 2407 199
1668839023 2817 167
1668792831 1945 113
1668758379 2712 262
1668751522 1916 117
1668725839 2964 193
1668682748 2490 259
1668646062 2024 153
1668613457 425 33
1668591683 4420 262
1668579624 1991 114
1673659546 1989 175
1673630085 2773 181
1673628179 894 79
1673584099 2005 237
1673558412 580 91
1673552043 3838 285
1673477884 1500 163
1673447710 883 82
1673432700 3859 1063
1673371349 1385 153
1673354401 4944 1774
1673341849 2128 175
1673210350 1651 170
1673208977 3271 187
1673194213 4573 185
1673099701 4016 265
1673081038 1684 173
1673078706 5623 605
1671437866 1669 155
1671432637 1960 193
1671421953 2418 128
1671360687 2537 227
1671358182 2289 197
1671340219 2252 147
1671274952 2830 190
1671265441 584 58
1671256008 1897 131
1671210956 753 65
1671208055 750 88
1671201476 2988 192
1673865688 2405 306
1673815749 2297 160
1673789962 959 82
1673748036 3258 299
1673738064 1464 129
1674031017 8348 1389
1673941543 3037 326
1684521403 8327 864
1684419960 12377 1247
1684334726 12205 777
1684227514 26128 2086
1686931489 23767 1689
1686838227 8442 1362
1686604927 20083 22662
1685000902 19056 1140
1684903975 9133 1491
1684809000 27906 7860
1684715899 7929 2930
1684571786 17402 32064
1689417916 22894 1178
1689326808 8206 423
1689199207 9383 940
1689080648 10170 1174
1687304352 8252 637
1687199442 25008 990
1687118078 4155 608
1687063262 4953 624
1687000541 14291 1468
1691952611 19855 1926
1691887181 12167 982
1691817562 13221 1384
1691714801 5513 440
1691612847 8265 513
1689893744 11548 1250
1689812780 8687 913
1689744737 9905 980
1689659635 5921 618
1689593268 7858 631
1689526977 9744 1332
1689486729 7228 981
1694672562 11562 939
1694607827 11970 1261
1694506494 17604 1325
1694392262 10412 1526
1694261668 18232 2644
1692105377 6830 527
1692027822 9317 792
1697676707 19666 1558
1697618202 41785 3910
1697367568 16288 1354
1697230041 26940 2155
1694785141 9740 863
1694734460 7858 633
1697818230 45381 3451
1697737102 25849 1799
1666209170
1666177296
1666148259
1666125998
1666122929
1666088527
1666048848
1666045478
1665990348
1665986855
1665972746
1665829829
1665826280
1665822701
1665700254
1665686446
1665685543
1668556845
1668507634
1668506691
1668493996
1668437721
1668434795
1668432255
1668345858
1668338643
1668319630
1668245426
1668243304
1668240246
1668137863
1668110665
1668109169
1668012309
1667995496
1667987887
1666577877
1666539842
1666460321
1666453945
1666424868
1666372636
1666366844
1666366213
1666308348
1666286219
1666276978
1666238587
1666185341
1671129267
1671123709
1671121575
1671067751
1671063488
1670993670
1670974602
1670963917
1670901885
1670865252
1670863093
1670808701
1670707254
1670702068
1670686522
1670611989
1670594877
1670592135
1668862986
1668839023
1668792831
1668758379
1668751522
1668725839
1668682748
1668646062
1668613457
1668591683
1668579624
1673659546
1673630085
1673628179
1673584099
1673558412
1673552043
1673477884
1673447710
1673432700
1673371349
1673354401
1673341849
1673210350
1673208977
1673194213
1673099701
1673081038
1673078706
1671437866
1671432637
1671421953
1671360687
1671358182
1671340219
1671274952
1671265441
1671256008
1671210956
1671208055
1671201476
1673865688
1673815749
1673789962
1673748036
1673738064
1674031017
1673941543
1684521403
1684419960
1684334726
1684227514
1686931489
1686838227
1686604927
1685000902
1684903975
1684809000
1684715899
1684571786
1689417916
1689326808
1689199207
1689080648
1687304352
1687199442
1687118078
1687063262
1687000541
1691952611
1691887181
1691817562
1691714801
1691612847
1689893744
1689812780
1689744737
1689659635
1689593268
1689526977
1689486729
1694672562
1694607827
1694506494
1694392262
1694261668
1692105377
1692027822
1697676707
1697618202
1697367568
1697230041
1694785141
1694734460
1697818230
1697737102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment