Skip to content

HofUniversityCanteenAPI is a small functional libary for accessing and filtering the canteen plan of Hof University.

Notifications You must be signed in to change notification settings

stevensolleder/HofUniversityCanteenAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PersistentObjectStorage

Release PHP

Introduction

HofUniversityCanteenAPI is a small functional libary for accessing and filtering the canteen plan of Hof University.
It is written in PHP 7.3 and above. HofUniversityCanteenAPI is not supported nor endorsed by Studentenwerk Oberfranken or Hochschule Hof.

Data structure

classDiagram
    Week "1" -- "n" Day
    Day "1" -- "n" Dish

    class 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 "HofUniversityCanteenAPI"-folder in your project and import the the used functions:

include "HofUniversityCanteenAPI/Helper.php";
use function HofUniversityCanteenAPI\convertAllUnconvertedDataToWeek;
use function HofUniversityCanteenAPI\convertWeekToFormatedGermanString;
use function HofUniversityCanteenAPI\downloadAllUnconvertedData;
use function HofUniversityCanteenAPI\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.

Get in contact

Feel free to get in contact and share your experience with HofUniversityCanteenAPI. Bug reports are also very appreciated.

About

HofUniversityCanteenAPI is a small functional libary for accessing and filtering the canteen plan of Hof University.

Topics

Resources

Stars

Watchers

Forks

Languages