Git Product home page Git Product logo

temperaturerestservice's Introduction

TemperatureRestService

A TemperatureRestService/1.0 was a very simple PHP pseudo-REST service which could read data from DS18B20 thermometers attached to Raspberry Pi and present them as plain text, JSON or Windows Notification Service data.

With version 2.0, it's now RESTful service for storing, updating and sending data from different types of sensors, mostly temperature sensors. A POST to a specific URL will create a sensor data, or update it, and such data may be requested in different forms (plain text, HTML, JSON, WNS) by GET request. Application is now a lot more flexible, allowing storage of different sensor data with better customization of possible formats supported.

Examples

Sending GET HTTP request to address:

http://example.com/

Will result in showing information page about a service. If you go to:

http://example.com/sensor

You'll get a data associated with sensor named "sensor" (if there is one) in a format most suitable for your device (usually - HTML).

If you go to:

http://example.com/sensor/json

You'll get data of a "sensor" in JSON format. Alternatively, you may use:

http://example.com/sensor.json

(or sensor.txt, sensor.html, sensor.wns and so on).

Libraries

This application uses composer - required PHP 5.4 or greater and two more dependencies - dispatch, micro PHP framework, avaliable at http://noodlehaus.github.io/dispatch/ and http://williamdurand.fr/Negotiation/, a standalone library implementing content negotiation.

Configuration

Configuration is bloody simple, everything is now in config.ini file (sample included in repo), allowing you only to change base URL, folders for data and views and APIKEY, which should be different than the standard one.

Have fun! -- ktos

temperaturerestservice's People

Contributors

ktos avatar

Watchers

James Cloos avatar  avatar  avatar

temperaturerestservice's Issues

Different views for sensors

There is a need to create different WNS views for each sensor, so they may be notified in different ways. Probably same for HTML view.

pullable sensors

Some sensors will be marked as "pullable" and automatically updated when last updated time is greater than some interval by running some command or visiting URL.

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.