A public API endpoint using WoTKit data to compute average sensor values.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: node-red | |
# Required-Start: $local_fs $remote_fs $network | |
# Required-Stop: $local_fs $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start or stop the node-red server | |
### END INIT INFO | |
# Can be downloaded and installed in one go by using this command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html lang="en"> | |
<head> | |
<title>Chat</title> | |
<script type="text/javascript" src="jquery-1.7.2.min.js"></script> | |
<script type="text/javascript" src="jquery.thingbroker-0.3.0.min.js"></script> | |
<style type="text/css"> | |
p {color:gray;font-size:16px; font-style:bold; width:100px; height:100px; background-color:#E9E74A; float:left; margin-left:5px; margin-top:5px;padding:4px} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
import httplib, urllib, base64, json | |
#TODO: ADD YOUR SENSOR NAME AND CREDENTIALS | |
SENSOR_NAME = 'mike.yvr-arrive' | |
USERNAME = 'YOURUSERNAME' | |
PASSWORD = 'YOURPASSWORD' | |
HOST = 'wotkit.sensetecnic.com' | |
auth = base64.encodestring('%s:%s' % (USERNAME, PASSWORD)).replace('\n', '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
import httplib, urllib, base64, json | |
import pandas as pd | |
#TODO: ADD YOUR SENSOR NAME AND CREDENTIALS | |
SENSOR_NAME = 'mike.yvr-arrive' | |
USERNAME = 'YOURWOTKITUSERNAME' | |
PASSWORD = 'YOUROWOTKITPASSWORD' | |
HOST = 'wotkit.sensetecnic.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Return an error if data is empty. | |
if (msg.payload.length === 0){ | |
msg.payload = {"error":"no data found"}; | |
return msg; | |
} | |
// Get the values as an array | |
var values = [] | |
var sensors = [] | |
msg.payload.map(function(element){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
# Dependencies: | |
# pip install flask | |
# pip install redis | |
from flask import Flask | |
from flask import request | |
import flask | |
import redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import app | |
import unittest | |
import json | |
from random import randint | |
mocked_value = randint(0,255) | |
class AppTestCase(unittest.TestCase): | |
def setUp(self): | |
self.app = app.app.test_client() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PRINT_TOPIC = 1 | |
PAPER_ORIENTATION = 2 | |
APPLICATION_TOPIC = 3 | |
NO_HELP_TOPIC = -1 | |
class HelpHandler (object): | |
def __init__(self, successor=0, topic=NO_HELP_TOPIC): | |
self._successor = successor | |
self._topic = topic | |
def HasHelp(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
import stsplatform.client as sts | |
SENSOR_NAME = 'mike.yvr-arrive' | |
def main(): | |
conf = { | |
"url":"http://wotkit.sensetecnic.com/api", | |
} |
OlderNewer