Giter VIP home page Giter VIP logo

eat-api's People

Contributors

com8 avatar jpbernius avatar kordianbruck avatar raabf avatar srehwald avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eat-api's Issues

Parsing fmi-bistro fails

If I try to parse the dishes for the FMI, it fails:
$ python3 main.py fmi-bistro

Traceback (most recent call last):
  File "main.py", line 94, in <module>
    main()
  File "main.py", line 58, in main
    menus = parser.parse(location)
  File "/home/fabian/test/eat-api/src/menu_parser.py", line 173, in parse
    week_number = int(pdf_name.split("_")[2].replace("KW","").lstrip("0"))
ValueError: invalid literal for int() with base 10: ''

[website] specify canteen via url parameter

pretty much the title. i think being able to specify the canteen you're interested in via a query parameter would be really useful, and a lot faster than having to go through the dropdown menu, especially on mobile

IPP bistro parsing crashes

The IPP parser for the current week crashes, because there are no dishes on Wednesday available.
Link to the PDF.

The parser fails here

        positions = [(a.start(), a.end()) for a in list(re.finditer('Tagessuppe siehe Aushang', lines[0]))]
        if len(positions) != 5:
            # TODO handle special cases (e.g. that bistro is closed)
            return None

-> It returns None

How to reproduce:

$ python3 main.py ipp-bistro

Btw. I'm using #18 to fix the KW parsing crash.

incorrect menu for fmi-bistro

I've noticed that the API returns the wrong dishes for fmi-bistro. The PDFs published here show the current menu.

For instance today (it's Friday 11.01.2019) the API returns:

Minestrone | 1.00€
Grieß-Kokosmilch mit warmen Himbeeren | 3.20€
Schwäbischer Ofenschlüfer | 3.20€
Fischfilet in Kartoffelpanade dazu Kartoffel-Fenchelgemüse | 4.60€

But the actual menu is as follows:

Menu Friday 11.01.2019

Fetch prices during parsing

Prices for dishes are currently hard coded. In order to always have the most up-to-date prices, they need to be parsed from the STWM homepage.

Parsing ipp-bistro fails

If I try to parse the dishes for the IPP, it fails:

$ python3 main.py ipp-bistro

Traceback (most recent call last):
  File "main.py", line 112, in <module>
    main()
  File "main.py", line 76, in main
    menus = parser.parse(location)
  File "/home/fabian/eat-api/menu_parser.py", line 287, in parse
    call(["pdftotext", "-l", "1", "-layout", temp_pdf.name, temp_txt.name])
  File "/usr/lib/python3.5/subprocess.py", line 247, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.5/subprocess.py", line 676, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.5/subprocess.py", line 1282, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'pdftotext'

It seems like it misses the pdftotext file.

[Feature] Command for all available canteens

A command that returns all available canteens in a Json array would be great to automate the process of requesting all menus for all canteens.

Examle output:

[
{
"name":"Mensa Arcisstraße",
"address":"Arcisstr. 17, München",
"latitude":"48.147312",
"longitude":"11.567229"
},
{
"name":"Mensa Garching",
"address":"Lichtenbergstr. 2, Garching",
"latitude":"48.267509",
"longitude":"11.671278"
},
[...]
]

[Feature] Support for side/action/... dishes

Currently the parser shows only dishes of the day.
It would be great if it would show all types of dishes.

They could get represented like:

 "dishes": [
    {
      "name": "Bio-Tortelloni all'arrabiata",
      "type": "Tagesgericht",
      "price": 1.9
    },
    {
      "name": "Nudeln",
      "type": "Beilagen",
      "price": 0.6
    },
    {
      "name": "Reis",
      "type": "Beilagen",
      "price": 1
    },
    {
      "name": "Bio-Spaghetti bolognese",
      "type": "Aktion",
      "price": 3
    }
  ]

FMI Title Garching-Speiseplan → Garching_Speiseplan

Since new year FMI Bistro changed the title (snippet from bistro homepage):

  <a href="http://www.wilhelm-gastronomie.de/wp-content/uploads/2017/12/Garching_Speiseplan_KW02_2018.pdf">Garching_Speiseplan_KW02_2018</a>

xpath_query = tree.xpath("//a[contains(text(), 'Garching-Speiseplan')]/@href")

So just change Garching-Speiseplan → Garching_Speiseplan and it works (I spare a MR just for one line). Let’s hope this change is persistent.

Current state

I'm creating this issue to request clarification about the current state of the eat-api.

@srehwald are you still planing to actively maintain this project?

If YES:

  • When can we expect our changes being review and merged?
  • Will it always take so long until changes are being reviewed and merged?

If NO:

  • What do you think about adding other people as Collaborators ?
  • Should somebody create a fork where we will create all future PRs?

Ping: @raabf , @kordianbruck , @moredatapls , @jpbernius

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.