Skip to content
This repository has been archived by the owner on Aug 28, 2020. It is now read-only.

Commit

Permalink
Fixed issue with the alerte feature
Browse files Browse the repository at this point in the history
  • Loading branch information
nbr23 committed Jun 5, 2015
1 parent 7e550a5 commit 0817530
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/nextstop.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def main():
if cause == "" or type_transp == "":
printUsage(sys.argv[0])
return 1
return ratp.getDisturbance(cause, type_transp)
print(ratp.getDisturbance(cause, type_transp))
return 0
if type_transp == "" or line == "":
printUsage(sys.argv[0])
return 1
Expand Down
6 changes: 5 additions & 1 deletion src/ratp.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ def getDisturbance(cause, transport):
page = getPage('/siv/perturbation?cause=%s&reseau=%s' % (cause, transport))
soup = bs4.BeautifulSoup(page)
content = soup.find_all('div', { "class" : "bg1" })
disturbances = ""
for item in content:
if disturbances != "":
disturbances += "\n"
item = str(item).replace('<br/>', ' ').replace(' ', ' ')
print(bs4.BeautifulSoup(item).get_text())
disturbances += (bs4.BeautifulSoup(item).get_text())
return disturbances

0 comments on commit 0817530

Please sign in to comment.