Use the following chart to find the time zone for your device. The following two examples will show you how to find the correct time zone value:
Now, we will look at how to display the temperature data on a web page using HTML and JavaScript by connecting to the Xively cloud.
index.html
file from the code folder of Chapter 5
to your computer's hard drive.var device_id = "NB101706"; // Your device ID var user = "****"; // Your NearBus Web user var pass = "****"; // Your NearBus Web password
Following are the variables:
device_id
: Your NearBus device IDuser
: Your NearBus user namepass
: Your NearBus password1
with your NearBus channel ID:ret = NearAPIjs( "ADC_INPUT", device_id , 1, 0, "RONLY" );
1910481586
with your Xively device Feed ID, 1.png
with your NearBus channel ID (only replace the number part) and 5.5
with your time zone.<div id="div_temp_chart_cm"> <img src="https://api.cosm.com/v2/feeds/1910481586/datastreams/1.png?width=750&height=400&colour=%23f15a24&duration=3hours&show_axis_labels=true&detailed_grid=true&timezone=5.5" > </div>
You can also modify the cosm to Xively in the preceding URL because both are working. The modified URL can be written as follows:
<div id="div_temp_chart_cm"> <img src="https://api.xively.com/v2/feeds/1910481586/datastreams/1.png?width=750&height=400&colour=%23f15a24&duration=3hours&show_axis_labels=true&detailed_grid=true&timezone=5.5" > </div>
18.225.57.126