Skip to content

Commit

Permalink
Add Egnatia logo
Browse files Browse the repository at this point in the history
  • Loading branch information
sindrig committed Jul 23, 2024
1 parent c716e09 commit 9ae8fb9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions clock/src/club-ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,5 @@ export default {
Æskan: "139060",
Örninn: "145472",
"Shamrock Rovers": "142447",
"Egnatia": "150334",
};
Binary file added clock/src/images/club-logos/Egnatia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions clock/src/images/clubLogos.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ import { default as valur } from "./club-logos/Valur.png";
import { default as valurreyðarf } from "./club-logos/Valur Reyðarf.png";
import { default as þorlákur } from "./club-logos/Þorlákur.png";
import {default as shamrockrovers} from "./club-logos/Shamrock Rovers.png";
import {default as egnatia} from "./club-logos/Egnatia.png";

export default {
"Afganistan": afganistan,
Expand Down Expand Up @@ -780,4 +781,5 @@ export default {
"Þór-KA": þórka,
"Þýskaland": þýskaland,
"Shamrock Rovers": shamrockrovers,
"Egnatia": egnatia,
};
11 changes: 8 additions & 3 deletions utils/add_club.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,25 @@ def main(club_id, out_folder, club_name=None):
if not club_name:
raise RuntimeError("Club name not found")
club_name_var_name = club_name.replace(" ", "").lower()
img_url = None
for img_tag in soup.findAll("img"):
if img_tag.get("alt", "") == "Model.BasicInfo.ShortName":
img_url = img_tag["src"]
break
else:
raise RuntimeError("Did not find img!")

exts = [os.path.splitext(str(img_url))[1], ".svg"]
exts = [
os.path.splitext(str(img_url))[1],
".svg",
".png",
]
for ext in exts:
path = os.path.join(out_folder, "%s%s" % (club_name, ext))
if os.path.isfile(path):
print("%s exists" % (path,))
break
else:
if not img_url:
raise RuntimeError("Did not find img!")
path = os.path.join(out_folder, "%s%s" % (club_name, exts[0]))
r2 = requests.get(get_absolute_url(img_url))
r2.raise_for_status()
Expand Down

0 comments on commit 9ae8fb9

Please sign in to comment.