Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
/ dsb-go Public archive

This library lets you access content from DSBmobile in golang.

License

Notifications You must be signed in to change notification settings

irgendwr/dsb-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dsb-go

GoDoc Travis

This library lets you access content from DSBmobile in Go (golang).

Unfortunately the heinekingmedia GmbH does not provide any official APIs nor documentation for developers. That sucks! This is why I reverse-engineered their app + website and developed a php script back in 2016 when I was still in school. I later moved on to using Go and created this package.

Contributions are welcome! Please give this repository a star ⭐ if it helped you.

Disclaimer

This is currently not actively maintained since I do not use DSBmobile.

"DSBmobile" and "Digitales Schwarzes Brett" are part of the heinekingmedia GmbH. I am not affiliated with them in any way nor do I endorse their products.

Installation

go get -u github.com/irgendwr/dsb-go

Example

package main

import (
	"fmt"
	"os"

	"github.com/irgendwr/dsb-go"
)

func main() {
	// set credentials
	account := dsb.NewAccount("user", "password")
	// get content
	content, err := account.GetContent()

	if err != nil {
		// exit on error
		fmt.Printf("Error: %s", err)
		os.Exit(1)
	}

	// get timetables
	timetables := content.GetTimetables()
	if len(timetables) == 0 {
		fmt.Println("no timetables found")
		return
	}

	// print all url's
	for i, timetable := range timetables {
		fmt.Printf("URL #%d: %s", i, timetable.GetURL())
	}
}

About

This library lets you access content from DSBmobile in golang.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages