Skip to content

Commit 9903ed4

Browse files
committed
fix the missing logos
1 parent 69a4139 commit 9903ed4

15 files changed

+125
-14
lines changed

logo_fix.ipynb

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"import os\n",
10+
"import json\n",
11+
"import urllib.request"
12+
]
13+
},
14+
{
15+
"cell_type": "code",
16+
"execution_count": null,
17+
"metadata": {},
18+
"outputs": [],
19+
"source": [
20+
"YEARS = [1952, 1960, 1967, 1968, 1969, 1977, 1980, 1981, 1984, 1989, 1990, 1992, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2012]\n",
21+
"\n",
22+
"to_fix = { ('Olympians') : 'https://i.imgur.com/vjW7r14.png',\n",
23+
" ('Amigos') : 'https://i.imgur.com/lT1DBBi.png',\n",
24+
" ('Stars') : 'https://i.imgur.com/v3Z4bvn.png'}"
25+
]
26+
},
27+
{
28+
"cell_type": "code",
29+
"execution_count": null,
30+
"metadata": {},
31+
"outputs": [],
32+
"source": [
33+
"for yr in range(1952,2020):\n",
34+
" with open('rosters/auto_roster_{}.json'.format(yr),'rt') as fp:\n",
35+
" base = json.load(fp)\n",
36+
" fixed = False\n",
37+
"\n",
38+
" for t in base['teams']:\n",
39+
" url = t['imgURL']\n",
40+
" key = (t['name'])\n",
41+
" if key in to_fix:\n",
42+
" if t['imgURL'] != to_fix[key]:\n",
43+
" t['imgURL'] = to_fix[key]\n",
44+
" print('fixed',key)\n",
45+
" fixed = True\n",
46+
" #try:\n",
47+
" # resp = urllib.request.urlopen(url)\n",
48+
" #except:\n",
49+
" # print(t['name'],yr)\n",
50+
" if fixed:\n",
51+
" with open('rosters/auto_roster_{}.json'.format(yr),'wt') as fp:\n",
52+
" json.dump(base,fp, sort_keys=True)"
53+
]
54+
},
55+
{
56+
"cell_type": "code",
57+
"execution_count": null,
58+
"metadata": {},
59+
"outputs": [],
60+
"source": [
61+
"base['teams'][0]['imgURL']"
62+
]
63+
},
64+
{
65+
"cell_type": "code",
66+
"execution_count": null,
67+
"metadata": {},
68+
"outputs": [],
69+
"source": [
70+
"urllib.request.urlopen(url)"
71+
]
72+
},
73+
{
74+
"cell_type": "code",
75+
"execution_count": null,
76+
"metadata": {},
77+
"outputs": [],
78+
"source": [
79+
"resp.length"
80+
]
81+
},
82+
{
83+
"cell_type": "code",
84+
"execution_count": null,
85+
"metadata": {},
86+
"outputs": [],
87+
"source": []
88+
}
89+
],
90+
"metadata": {
91+
"kernelspec": {
92+
"display_name": "Python 3",
93+
"language": "python",
94+
"name": "python3"
95+
},
96+
"language_info": {
97+
"codemirror_mode": {
98+
"name": "ipython",
99+
"version": 3
100+
},
101+
"file_extension": ".py",
102+
"mimetype": "text/x-python",
103+
"name": "python",
104+
"nbconvert_exporter": "python",
105+
"pygments_lexer": "ipython3",
106+
"version": "3.6.8"
107+
}
108+
},
109+
"nbformat": 4,
110+
"nbformat_minor": 2
111+
}

mega_1952.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

mega_1968.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

mega_1969.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

rosters/auto_roster_1952.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

rosters/auto_roster_1953.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

rosters/auto_roster_1968.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

rosters/auto_roster_1969.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

rosters/auto_roster_1970.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

rosters/auto_roster_1971.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)