Skip to content
This repository has been archived by the owner on Dec 29, 2019. It is now read-only.

Commit

Permalink
Edit Metro line output
Browse files Browse the repository at this point in the history
  • Loading branch information
MaanuelMM committed Jul 28, 2019
1 parent f4f9b0a commit 614f86f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def generate_metro_data_response(metro_data):
response = {}
soup = BeautifulSoup(metro_data, "html.parser")
for img in soup.find_all("img"):
line = img.get('class')[0].replace("-", " ").capitalize()
line = img.get('class')[0].replace("-", " ").upper()
estimations = re.sub(r'\s\s+', r'\n ', img.parent.next_sibling.next_sibling.text).strip()
if line not in response:
response[line] = []
Expand All @@ -174,7 +174,7 @@ def process_metro_response(metro_data):
result = ""
for k, v in generate_metro_data_response(metro_data).items():
result += "\n\n"
result += k.replace("Linea", "Línea")
result += k.replace("LINEA", "LÍNEA")
for item in v:
result += "\n "
result += item
Expand Down

0 comments on commit 614f86f

Please sign in to comment.