Latest 0.1.0
Homepage https://github.com/kiliankoe/OpenMensaKit
License MIT
Platforms ios 8.0, osx 10.9, watchos 2.0, tvos 9.0
Frameworks Foundation
Authors

🍛 OpenMensaKit

Access canteen and meal data from OpenMensa.

Quick Start

There’s two types here, Canteen and Meal (and Meal.Price for the sake of completeness), with static funcs to fetch some data.

// Get a single canteen if you know the ID.
Canteen.get(withID: 79) { result in
    guard let canteen = result.success else { return }
    print(canteen)
}

// Get a list of canteens with known IDs.
Canteen.get(withIDs: [79, 80]) { result in
    guard let canteens = result.success else { return }
    print(canteens)
}

// Find a list of canteens near a given coordinate. A search radius can also be specified.
Canteen.find(near: coordinate) { result in
    guard let canteens = result.success else { return }
    print(canteens)
}

// Get a list of meals if you have a canteen on hand.
canteen.getMeals(forDay: Date()) { result in
    guard let meals = result.success else { return }
    print(meals)
}
// Get a list of meals for a canteen on a specific day.
Meal.get(forCanteen: 79, onDay: Date()) { result in
    guard let meals = result.success else { return }
    print(meals)
}

That’s basically it. Got any questions, problems or ideas? Please don’t hesitate to open an issue.

Installation

OpenMensaKit is available through Cocoapods, Carthage/Punic and Swift Package Manager, whatever floats your boat.

// Cocoapods
pod 'OpenMensaKit'

// Carthage
github "kiliankoe/OpenMensaKit"

// Swift Package Manager
.Package(url: "https://github.com/kiliankoe/OpenMensaKit", majorVersion: 0)

Authors

Kilian Koeltzsch, @kiliankoe

Latest podspec

{
    "name": "OpenMensaKit",
    "version": "0.1.0",
    "summary": "Query OpenMensa for canteen and meal data",
    "description": "Query the OpenMensa API for canteen and meal data.",
    "homepage": "https://github.com/kiliankoe/OpenMensaKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Kilian Koeltzsch": "[email protected]"
    },
    "social_media_url": "https://twitter.com/kiliankoe",
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source": {
        "git": "https://github.com/kiliankoe/OpenMensaKit.git",
        "tag": "0.1.0"
    },
    "source_files": "Sources/**/*",
    "frameworks": "Foundation",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This