Giter VIP home page Giter VIP logo

mensa.jetzt's Introduction

Mensa.JETZT

Do you struggle to coordinate the timings of your canteen visits with friends?

Worry no longer! Mensa.Jetzt will provide you with an easy to use canteen coordination interface.

Just select the time and enter your name and you will be shown on a list of canteen goers, where everyone else can find you and coordinate the canteen going efforts.

Installation

This tool is written in php so you can just drop it on your webserver (provided you still have one with php installed). You need to create a folder in the parent folder of you webroot named data and grant permissions to the webserver user. You do not need a database. Standard php extensions and php 5.4 should do the job.

Configuration

Some things are only configurable in the source code. You can/should configure oauth for user management. Most strings are configurable. Just copy the config.php.default to config.php and change the values accordingly.

Multi-Domain-Support

Multipage support is implemented, but a bit cursed. Just write a config.php like:

<?php
$oauth_client_id = "";
$oauth_client_secret = "";
$oauth_token_url = "";
$oauth_userinfo_url = "";


if ($_SERVER['HTTP_HOST'] == "mensa.jetzt") {
    $canteen_types = ["OnlyOneTypeHere"]; // Hides Type Selector
    $times = ["11:30 Uhr", "11:45 Uhr", "12:00 Uhr", "12:15 Uhr", "12:30 Uhr", "12:45 Uhr", "13:00 Uhr", "13:15 Uhr", "13:30 Uhr", "13:45 Uhr", "14:00 Uhr", "14:15 Uhr"];
    $default_time = "12:00 Uhr";
    $dataDirectory = "../data1";
    $endHour = 15;
    $pageTitle = "Mensa.Jetzt";
    $oauth_redirect_url = "https://mensa.jetzt/oauth.php";
    $lang_overview_sentence = "in der Mensa";
    $lang_also_there_sentence = "Du bist %word auch in der Mensa?";
    $lang_change_time_sentence = "Du bist %word doch wann anders in der Mensa?";
} else if ($_SERVER['HTTP_HOST'] == "2.mensa.jetzt") {
    $canteen_types = ["A", "B", "C"];
    $times = ["OnlyOneTimeHere"]; // Hides time selector
    $default_time = "OnlyOneTimeHere";
    $dataDirectory = "../data2";
    $endHour = 23;
    $oauth_redirect_url = "https://2.mensa.jetzt/oauth.php";
    $pageTitle = "Mensa.Jetzt 2";
    $lang_overview_sentence = "in der Mensa (2)";
    $lang_also_there_sentence = "Du bist %word auch in der Mensa (2)?";
    $lang_change_time_sentence = "Du bist %word doch wann anders in der Mensa (2)?";
}

$oauth_request_url = "https://yourOauthDomain/oauth/authorize?client_id=".$oauth_client_id."&redirect_uri=".$oauth_redirect_url."&response_type=code&scope=openid+profile";

WHY PHP???

I wanted to just quickly write a small tool, mostly for shitposting with the domain name. The initial version had just 100 lines index.php so php seemed to be the easiest choice.

Ok, but why no database?

I felt like sqlite was to much of a hassle for such a small project. Than I added features...

mensa.jetzt's People

Contributors

strifel avatar

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.