This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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? |
NewerOlder