Git Product home page Git Product logo

dsbmobile-php-api's Introduction

dsbmobile-php-api

Documentation Travis

This library lets you access content from DSBmobile in php.

Requirements

  • PHP 5.4.x or newer
  • curl module for php (on debian/ubuntu: apt install php7.0-curl)

Example

Basic example

<?php
include('path/to/dsb_api.php');

// log in
$dsb = new DsbAccount('username', 'password');

// get the url of the first timetable
$timetableUrl = $dsb->getTimetables()->getItem(0)->getUrl();

if ($timetableUrl) {
    echo '<a href="' . $timetableUrl . '">Timetable</a>';
} else {
    // an error occurred
    echo '<h2>Something went wrong 🙁</h2>';
}

Display every timetable

// get all timetables
$timetables = $dsb->getTimetables()->getItems();

// loop through every one of them
foreach ($timetables as $timetable) {
    // output their html code
    echo $timetable->getHTML();
}

// check if an error occurred
if (count($timetables) == 0) {
    echo '<h2>Something went wrong 🙁</h2>';
}

A complete list of methods can be found in the documentation.

dsbmobile-php-api's People

Contributors

irgendwr avatar kariyakilp avatar krjan02 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

dsbmobile-php-api's Issues

curl_init()

Hey, ever seen that?

PHP Fatal error: Uncaught Error: Call to undefined function curl_init() in /dsb_api.php:91 Stack trace:d #0 /dsb_api.php(142): DsbAccount->getData() #1 /dsb_api.php(155): DsbAccount->getTopics() #2 /bot.php(8): DsbAccount->getTopic(0) #3 {main} thrown in /dsb_api.php on line 91

Some ideas?
Linux kernel.
php7 and curl provided

Wie kann man Bilder und News abrufen?

Ich bin dabei unserer Schule eine Art Dashboard zu programmieren. Ich würde gerne die Stundenpläne auch miteinbinden. Die Stundenpläne ist unter Aushänge als Bilder gespeichert. Ist es möglich mit deiner API diese auch abzurufen ?
Also das wäre dann quasi Menupunkt 2 ("Aushänge")
Und dann zum Beispiel Stundenplan 15 ...

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.