openmensarss

package module
v2.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 5 Imported by: 0

README

OpenMensaRSS

OpenMensaRSS Logo

OpenMensa RSS library and feed generation in Go.

Library Usage

This library offers two simple functions to query OpenMensa using go-openmensa for a canteen, which return a gorilla/feeds Feed.

The returned feed structs can subsequently be modified and exported as RSS or Atom.

Automatic RSS Feed Generation

This repository also implements automatic RSS feed generation. The feeds are generated daily and subsequently published on GitHub pages.

The published RSS feeds use the same IDs as OpenMensa, e.g. the TU Wien canteen is served at https://schicho.github.io/openmensarss/1098.xml.

More feeds can be found at https://schicho.github.io/openmensarss/.

How to Use the RSS Feeds

You can subscribe to any canteen's RSS feed using Tuwel (TU Wien's Moodle platform) or your preferred RSS reader. Just copy the feed URL and add it to your dashboard or reader to receive menu updates directly from OpenMensa.

On Tuwel, enable edit mode (top right), add a new RSS block, and paste the feed URL. Enable item descriptions to see prices and allergen details.

Documentation

Index

Constants

View Source
const OpenMensaRSSGenerator string = "OpenMensa RSS Generator"

Variables

View Source
var RSSMetadata = struct {
	Description string
	Author      *feeds.Author
	Link        *feeds.Link
	Image       *feeds.Image
}{
	Description: "Automated RSS feed using OpenMensa",
	Author:      &feeds.Author{Name: OpenMensaRSSGenerator, Email: "johann.schicho@tuwien.ac.at"},
	Link:        &feeds.Link{Href: "https://schicho.github.io/openmensarss/"},
	Image:       &feeds.Image{Url: "https://schicho.github.io/openmensarss/omrss.gif", Title: OpenMensaRSSGenerator, Link: "https://schicho.github.io/openmensarss/"},
}

RSSMetadata allows setting of general metadata for the feeds generated using this library's functions. All fields can be modified here before generation, or of course after generation on a per feed basis.

Functions

func FeedForCanteen

func FeedForCanteen(canteen *openmensa.Canteen, date time.Time) (*feeds.Feed, error)

FeedForCanteen creates a feed of the canteen menu on a certain day. The Canteen struct specifies the canteen from OpenMensa. The day is selected by passing a time stamp.

Throws an error if the OpenMensa API does not provide data for the specified input.

func FeedForCanteenID

func FeedForCanteenID(id int, date time.Time) (*feeds.Feed, error)

FeedForCanteenID creates a feed of the canteen menu on a certain day. The id specifies the canteen from OpenMensa. The day is selected by passing a time stamp.

Throws an error if the OpenMensa API does not provide data for the specified input.

Types

This section is empty.

Directories

Path Synopsis
cmd
generaterss command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址