https://github.com/stevensolleder/hofuniversitycanteendata
HofUniversityCanteenData is a small functional libary for accessing and filtering the canteen plan of Hof University.
https://github.com/stevensolleder/hofuniversitycanteendata
api canteen hof hof-university php
Last synced: 3 months ago
JSON representation
HofUniversityCanteenData is a small functional libary for accessing and filtering the canteen plan of Hof University.
- Host: GitHub
- URL: https://github.com/stevensolleder/hofuniversitycanteendata
- Owner: stevensolleder
- Created: 2021-08-31T18:20:20.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-05T22:12:29.000Z (6 months ago)
- Last Synced: 2025-02-09T07:19:32.571Z (4 months ago)
- Topics: api, canteen, hof, hof-university, php
- Language: PHP
- Homepage:
- Size: 225 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HofUniversityCanteenData

## Introduction
**HofUniversityCanteenData** is a small functional libary for accessing and filtering the canteen plan of Hof University.
It is written in PHP 7.3 and above. HofUniversityCanteenData is not supported nor endorsed by Studentenwerk Oberfranken or Hochschule Hof.
## Data structure
```mermaid
classDiagram
Week "1" -- "n" Day
Day "1" -- "n" Dishclass Week{
+array days
}class Day{
+string name
+DateTime date
+array mainCourses
+array sideDishes
+array desserts
+array salads
}class Dish{
+string name
+array attributes
+double collegeStudentPrice
}
```## Functions
Just copy the "HofUniversityCanteenData"-folder in your project and import the the used functions:
```
include "HofUniversityCanteenData/Helper.php";
use function HofUniversityCanteenData\convertAllUnconvertedDataToWeek;
use function HofUniversityCanteenData\convertWeekToFormatedGermanString;
use function HofUniversityCanteenData\downloadAllUnconvertedData;
use function HofUniversityCanteenData\filterWeekByAttributeIdsAndDayNumber;
```You can use the following self-explanatory functions:
- `getAttributeIdsTable():array`
- `downloadAllUnconvertedData(dayNumber:int, monthNumber:int):SimpleXMLElement`
- `convertAllUnconvertedDataToWeek(allUnconvertedData:SimpleXMLElement):Week`
- `filterWeekByAttributeIdsAndDayNumber(week:Week, attributeIds:array, dayNumber:int):Week`
- `convertWeekToFormatedGermanString(week:Week):string`## Testing
The library was tested manually. I could not find any bugs, but there still may be some.## Example
You can find a realistic example [here](https://github.com/stevensolleder/HofUniversityCanteenData/blob/main/Example.php).
## Get in contact
Feel free to get in contact and share your experience with **HofUniversityCanteenData**. Bug reports are also very appreciated.