Ver código fonte

Update Reaktori to be fazerfood branched from amica brand (same API)

Toni Fadjukoff 6 anos atrás
pai
commit
1176596fe9
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      amica.py

+ 3 - 1
amica.py Ver arquivo

@@ -4,7 +4,7 @@ import datetime
4 4
 restaurant_info = [
5 5
   [ "(TaY) Amica Minerva", "http://www.amica.fi/minerva", "", "middle", "https://www.amica.fi/modules/json/json/Index?costNumber=0815&language=fi" ],
6 6
   [ "(TaY) Tampereen normaalikoulun ravintola", "http://www.amica.fi/tampereennormaalikoulu", "", "middle", "https://www.amica.fi/modules/json/json/Index?costNumber=0811&language=fi" ],
7
-  [ "(TTY) Ravintola Reaktori", "http://www.amica.fi/reaktori", "", "middle", "https://www.amica.fi/modules/json/json/Index?costNumber=0812&language=fi" ]
7
+  [ "(TTY) Ravintola Reaktori", "https://www.fazerfoodco.fi/ravintolat/Ravintolat-kaupungeittain/tampere/reaktori/", "", "middle", "https://www.fazerfoodco.fi/modules/json/json/Index?costNumber=0812&language=fi" ]
8 8
 ]
9 9
 
10 10
 def get_restaurants(use_old, week):
@@ -27,6 +27,8 @@ def get_restaurants(use_old, week):
27 27
 
28 28
         week_foods = {}
29 29
         lunch_menus = data["MenusForDays"]
30
+        if not lunch_menus:
31
+            continue
30 32
         for lunch_menu in lunch_menus:
31 33
             date = lunch_menu["Date"].split("T")[0]
32 34
             try: