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
# Create an object from an eeml document | |
environment = Eeml::Environment.new_from_eeml(string_containing_eeml_representation) | |
# attributes available like this | |
puts environment.title | |
puts environment.description | |
puts environment.feed | |
# etc... | |
# alternatively would this be better? |
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
<html> | |
<head> | |
<title>Socket Test</title> | |
</head> | |
<body> | |
<h1>Cosm Websocket Test</h1> | |
<p>Status: <span id="status"></span></p> | |
<p>Current value: <span id="current_value"></span></p> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> | |
<script type="text/javascript"> |
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
stream0,2012-05-01T00:00:00Z,1 | |
stream0,2012-05-01T00:00:05Z,2 | |
stream0,2012-05-01T00:00:06Z,3 | |
stream0,2012-05-01T00:00:07Z,4 | |
stream1,2012-05-01T00:00:00Z,1 | |
stream1,2012-05-01T00:00:05Z,2 | |
stream1,2012-05-01T00:00:06Z,3 | |
stream1,2012-05-01T00:00:07Z,4 |
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
<? | |
// set some variables we'll use later | |
$timezone_offset = '-05'; // set to your local timezone offset from UTC | |
$raw_url = "http://urltoyourdata.xml"; // replace with actual path to your published raw data | |
$title = "The title for your feed"; // the title for your Cosm feed | |
// Get raw data | |
$raw_xml = simplexml_load_file($raw_url); |
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
<? | |
// set some variables we'll use later | |
$timezone_offset = '-06'; // set to your local timezone offset from UTC | |
$raw_url = "http://urltoyourdata.xml"; // replace with actual path to your published raw data | |
$title = "data logger"; // the title for your Cosm feed | |
$feed_id = 83211; | |
$api_key = "insert_api_key"; // this api key needs to have 'update' access to your feed |
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
#!/usr/bin/env python | |
import serial | |
import xml.etree.ElementTree as ET | |
import sys | |
import requests | |
import json | |
import time | |
import syslog |
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
#include <SPI.h> | |
#include <Ethernet.h> | |
#include <HttpClient.h> | |
#include <Cosm.h> | |
#define API_KEY "YOURAPIKEY" // your Cosm API key | |
#define FEED_ID YOURFEEDID // your Cosm feed ID | |
// MAC address for your Ethernet shield | |
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; |
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
require 'net/http' | |
require 'json' | |
require 'time' | |
feed_id = YOUR_FEED_ID | |
api_key = "YOUR_API_KEY" | |
payload = { :version => "1.0.0", :datastreams => [ | |
{ :id => "Temperature", :at => Time.now.iso8601, :current_value => "17.2"} | |
]}.to_json |
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 xively | |
import datetime | |
FEED_ID=123 | |
API_KEY="123abc" | |
api = xively.XivelyAPIClient(API_KEY) | |
feed = api.feeds.get(FEED_ID) |
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
// Copyright (c) 2003-2013, LogMeIn, Inc. All rights reserved. | |
// This is part of Xively4J library, it is under the BSD 3-Clause license. | |
package com.xively.client.utils; | |
import java.math.BigInteger; | |
import java.security.GeneralSecurityException; | |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; |
OlderNewer