Merge branch 'master' of github.com:iobridge/thingspeak
This commit is contained in:
@ -8,11 +8,15 @@ To view a specific Channel, send an HTTP GET to
|
||||
<br>
|
||||
<code><%= @ssl_api_domain %>channels/<span class="customcode">CHANNEL_ID</span><span class="format format-json">.json</span><span class="format format-xml">.xml</span></code> .
|
||||
|
||||
<br><br>
|
||||
Valid parameters:
|
||||
<ul>
|
||||
<li><b>api_key</b> (string) - User's API Key; please note that this is different than a Channel API key, and can be found in <a href="/account">your account details</a>. If this key is provided, the Channel's private details (such as the Channel's API keys) will also be shown. (optional).</li>
|
||||
</ul>
|
||||
<br>
|
||||
|
||||
<div class="format format-json format-xml">
|
||||
<br>
|
||||
Valid parameters:
|
||||
<ul>
|
||||
<li><b>api_key</b> (string) - User's API Key; please note that this is different than a Channel API key, and can be found in <a href="/account">your account details</a>. If this key is provided, the Channel's private details (such as the Channel's API keys) will also be shown. (optional).</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
Example GET:
|
||||
|
@ -64,8 +64,7 @@ POST <span class="str"><%= @ssl_api_domain %>update<span class="format format-js
|
||||
"status": null,
|
||||
"latitude": null,
|
||||
"longitude": null,
|
||||
"elevation": null,
|
||||
"location":null
|
||||
"elevation": null
|
||||
}
|
||||
</pre>
|
||||
|
||||
@ -92,7 +91,6 @@ POST <span class="str"><%= @ssl_api_domain %>update<span class="format format-js
|
||||
<latitude type="decimal" nil="true"/>
|
||||
<longitude type="decimal" nil="true"/>
|
||||
<elevation nil="true"/>
|
||||
<location nil="true"/>
|
||||
</feed>
|
||||
</pre>
|
||||
|
||||
|
69
app/views/docs/thingtweet.html.erb
Normal file
69
app/views/docs/thingtweet.html.erb
Normal file
@ -0,0 +1,69 @@
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-offset-1 col-sm-3 col-xs-12" id="leftcol">
|
||||
<%= render 'docs/sidebar' %>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-7 col-xs-12">
|
||||
|
||||
<h1 id="thingtweet">ThingTweet</h1>
|
||||
|
||||
The ThingTweet App allows you to update a Twitter status via ThingSpeak. Twitter requires Open Authentication (OAuth) which is difficult for a low level device to interface with. ThingTweet acts a Twitter proxy, so the device can use Twitter by making simple API calls.
|
||||
|
||||
<br><br>
|
||||
|
||||
<hr />
|
||||
<h2 id="setup">App Setup</h2>
|
||||
|
||||
Sign in to <a href="https://thingspeak.com/login">ThingSpeak</a>, select Apps from the menu, and then click on <a href="https://thingspeak.com/apps/thingtweet">ThingTweet</a>.
|
||||
<br><br>
|
||||
Under the ThingTweet App, select "Link new Twitter account". This will redirect you to Twitter to see if you want the app to have the ability to access your account. You can Allow or Deny the process. Once you have confirmed the right Twitter account, Twitter will send you back to ThingSpeak.
|
||||
<br><br>
|
||||
The app generates a ThingTweet API Key for you to use. If you send an HTTP POST with your ThingTweet API Key, then the message will be relayed to Twitter. All of the parameters from the Twitter API (<a href="https://dev.twitter.com/rest/reference/post/statuses/update">statuses/update</a>) are possible including geolocation.
|
||||
<br><br>
|
||||
|
||||
<hr />
|
||||
<h2 id="update">Update Twitter Status</h2>
|
||||
|
||||
To update your Twitter status send an HTTP POST to <code><%= @ssl_api_domain %>apps/thingtweet/1/statuses/update</code> and include your ThingTweet API key and message.
|
||||
<br><br>
|
||||
Example POST:
|
||||
|
||||
<pre>
|
||||
POST <span class="str"><%= @ssl_api_domain %>apps/thingtweet/1/statuses/update</span>
|
||||
api_key=<span class="customcode"><%= @thingtweet_api_key %></span>
|
||||
status=<span class="customcode">I just posted this from my thing!</span></pre>
|
||||
|
||||
<br>
|
||||
The response will be <code>1</code> if the update was successful, and <code>-1</code> if there was an error.
|
||||
<br><br>
|
||||
|
||||
<h4>Channel Values</h4>
|
||||
You can retrieve the last value from a Channel field by including the following in the ThingTweet status:
|
||||
<br><br>
|
||||
<code>%%channel_<span class="customcode">CHANNEL_ID</span>_field_<span class="customcode">FIELD_NUMBER</span>%%</code>
|
||||
<br><br>
|
||||
For example, you can send a Tweet that includes the last value from Channel 1417, field 1:
|
||||
<br><br>
|
||||
<code>status=The current CheerLights color is %%channel_<span class="customcode">1417</span>_field_<span class="customcode">1</span>%%.</code>
|
||||
|
||||
<br><br>
|
||||
<hr />
|
||||
<h2>Update Channel Feed and Twitter Status</h2>
|
||||
Your Twitter status can also be updated when a <a href="/docs/channels#update">Channel feed is updated</a> by specifying the <i>twitter</i> and <i>tweet</i> parameters.
|
||||
<br><br>
|
||||
Example Channel feed update that also updates a Twitter status:
|
||||
|
||||
<pre>
|
||||
POST <span class="str"><%= @ssl_api_domain %>update<span class="format format-json">.json</span><span class="format format-xml">.xml</span></span>
|
||||
api_key=<span class="customcode">XXXXXXXXXXXXXXXX</span>
|
||||
field1=<span class="customcode">73</span>
|
||||
twitter=<span class="customcode">thingspeaktest</span>
|
||||
tweet=<span class="customcode">I just posted this from my thing!</span>
|
||||
</pre>
|
||||
|
||||
<br><br><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
<br>
|
||||
|
||||
<h3>Getting Started with ThingSpeak</h3>
|
||||
<h3>Getting Started with ThingSpeak</h3>
|
||||
<ul>
|
||||
<li><a title="Introduction to the Internet of Things and ThingSpeak" href="http://community.thingspeak.com/tutorials/introduction-to-the-%E2%80%9Cinternet-of-things%E2%80%9D-and-thingspeak/">Introduction to the “Internet of Things” and ThingSpeak</a> </li>
|
||||
<li><a title="Video tutorial on creating ThingSpeak Channels" href="http://community.thingspeak.com/tutorials/thingspeak-channels/">ThingSpeak Channels</a> </li>
|
||||
@ -26,6 +26,7 @@
|
||||
<li><a title="CheerLights with Arduino and the FastLED Library" href="http://community.thingspeak.com/tutorials/arduino/cheerlights-with-arduino-and-the-fastled-library/" target="_blank">CheerLights with Arduino and the FastLED Library</a></li>
|
||||
<li><a title="RESTduino to ThingSpeak via Python" href="https://github.com/sirleech/RestduinoThingspeak" target="_blank">RESTduino to ThingSpeak via Python</a> [external]</li>
|
||||
<li><a title="Arduino ThingSpeak Example Source Code is on GitHub" href="https://github.com/iobridge/ThingSpeak-Arduino-Examples" target="_blank">Arduino Examples for ThingSpeak on GitHub</a> [external]</li>
|
||||
<li><a title="Freetronics Eleven Review and ThingSpeak Project" href="http://community.thingspeak.com/tutorials/freetronics/freetronics-eleven-review-and-thingspeak-project/">Freetronics Eleven Arduino Review and ThingSpeak Project</a></li>
|
||||
</ul>
|
||||
<h3>C</h3>
|
||||
<ul>
|
||||
@ -42,10 +43,6 @@
|
||||
<li><a title="Battery-powered Temperature Logger with ThingSpeak + Electric Imp" href="http://www.slickstreamer.info/2014/01/simpel-electric-imp-temperature-logger.html">Battery-powered Temperature Logger with ThingSpeak + Electric Imp</a> [external]</li>
|
||||
<li><a title="Solar-powered Temperature Logger with Electric Imp and ThingSpeak" href="https://gist.github.com/evilmachina/6402955">Solar-powered Temperature Logger with Electric Imp and ThingSpeak</a> [external]</li>
|
||||
</ul>
|
||||
<h3>Freetronics</h3>
|
||||
<ul>
|
||||
<li><a title="Freetronics Eleven Review and ThingSpeak Project" href="http://community.thingspeak.com/tutorials/freetronics/freetronics-eleven-review-and-thingspeak-project/">Freetronics Eleven Review and ThingSpeak Project</a></li>
|
||||
</ul>
|
||||
<h3>Google</h3>
|
||||
<ul>
|
||||
<li><a title="Google Gauge Visualization for a ThingSpeak Channel" href="http://community.thingspeak.com/google/display-a-google-gauge-visualization-using-thingspeak-plugins/">Display a Google Gauge Visualization using ThingSpeak Plugins</a></li>
|
||||
@ -107,6 +104,10 @@
|
||||
<li><a title="Using Arduino and Python to Update a ThingSpeak Channel" href="http://vimeo.com/19064691" target="_blank">Using Arduino and Python to Update a ThingSpeak Channel</a> </li>
|
||||
<li><a title="Connecting Arduino to Thingspeak using python as an middle ware" href="http://tenettech.com/blogspot/?p=918" target="_blank">Connecting Arduino to ThingSpeak using Python as Middle-ware</a> [external]</li>
|
||||
</ul>
|
||||
<h3>Raspberry Pi</h3>
|
||||
<ul>
|
||||
<li><a title="ThingSpeak Temperature with Raspberry Pi" href="http://www.dexterindustries.com/BrickPi/projects/thingspeak-temperature-log/" target="_blank">ThingSpeak Temperature with Raspberry Pi and BrickPi</a> [external]</li>
|
||||
</ul>
|
||||
<h3>Ruby</h3>
|
||||
<ul>
|
||||
<li><a title="ThingSpeak Ruby Gem" href="http://community.thingspeak.com/tutorials/ruby/thingspeak-api-ruby-gem/" target="_blank">ThingSpeak API Ruby Gem</a></li>
|
||||
@ -117,7 +118,8 @@
|
||||
</ul>
|
||||
<h3>Spark Core</h3>
|
||||
<ul>
|
||||
<li><a title="Spark Core Interface for ThingSpeak" href="https://community.spark.io/t/interface-for-thingspeak/2329">Spark Core Interface for ThingSpeak</a> [external [beta]</li>
|
||||
<li><a title="Control, monitor, and log a Spark Core with ThingSpeak" href="http://community.spark.io/t/control-monitor-and-log-a-spark-core-with-thingspeak/10543">Control and Monitor a Spark Core with ThingSpeak</a> [external] [beta]</li>
|
||||
<li><a title="Spark Core Interface for ThingSpeak" href="https://community.spark.io/t/interface-for-thingspeak/2329">Spark Core Interface for ThingSpeak</a> [external] [beta]</li>
|
||||
</ul>
|
||||
<h3>Twine</h3>
|
||||
<ul>
|
||||
@ -136,6 +138,10 @@
|
||||
<ul>
|
||||
<li><a title="How to Embed a ThingSpeak Chart on your WordPress Blog" href="http://community.thingspeak.com/wordpress/how-to-embed-a-thingspeak-chart-on-your-wordpress-blog/">How to Embed a ThingSpeak Chart on your WordPress Blog</a></li>
|
||||
</ul>
|
||||
<h3>Windows PowerShell</h3>
|
||||
<ul>
|
||||
<li><a title="Send data to ThingSpeak from a Windows PowerShell Script" href="https://github.com/nothans/ThingSpeak-PowerShell">Send Data to ThingSpeak from a Windows PowerShell Script</a></li>
|
||||
</ul>
|
||||
<h3>Wireless</h3>
|
||||
<ul>
|
||||
<li><a title="Connecting XBee Wireless Networks to ThingSpeak via the ConnectPort X2 running XIG" href="http://community.thingspeak.com/tutorials/wireless/connecting-xbee-wireless-networks-to-thingspeak-via-the-connectport-x2-running-xig/">Connecting XBee Wireless Networks to ThingSpeak via the ConnectPort X2 running XIG</a></li>
|
||||
|
@ -15,16 +15,13 @@
|
||||
|
||||
// add click handler
|
||||
$(document).on('click', '.ioplugin', function() {
|
||||
|
||||
var plugins = $(".plugin");
|
||||
var addPlugin = $(this);
|
||||
var ids = addPlugin.attr('id').split("-");
|
||||
var channelId = <%= params[:channel_id] %>;
|
||||
var windowId =ids[1];
|
||||
//Need to add data to this request to identify it as a plugin request
|
||||
var data = {plugin:true, visibility_flag:"<%= @visibility %>"};
|
||||
$.update("/channels/" + channelId + "/windows/"+ windowId + "/display" , data,
|
||||
function(response) {
|
||||
var channelId = <%= params[:channel_id] %>;
|
||||
var windowId = ids[1];
|
||||
|
||||
$.update("/channels/" + channelId + "/windows/"+ windowId + "/display", {}, function(response) {
|
||||
|
||||
var window = response.window;
|
||||
var window_type = window.window_type;
|
||||
@ -79,7 +76,7 @@
|
||||
<div id="tabs">
|
||||
<ul>
|
||||
<li><a href="#tabs-1">Windows</a></li>
|
||||
<% if @visibility =="private" %>
|
||||
<% if @visibility == "private" %>
|
||||
<li><a href="/plugins/private_plugins?channel_id=<%= params[:channel_id] %>">Plugins</a></li>
|
||||
<% else %>
|
||||
<li><a href="/plugins/public_plugins?channel_id=<%= params[:channel_id] %>">Plugins</a></li>
|
||||
|
Reference in New Issue
Block a user