update documentation
4
Gemfile
@ -1,6 +1,6 @@
|
||||
source 'http://rubygems.org'
|
||||
|
||||
gem 'rails', '4.0.2'
|
||||
gem 'rails', '4.0.3'
|
||||
gem 'jquery-rails', '3.0.4'
|
||||
gem 'rails_autolink'
|
||||
gem 'mysql2'
|
||||
@ -30,7 +30,7 @@ gem 'rack-utf8_sanitizer'
|
||||
gem 'newrelic_rpm'
|
||||
gem 'actionpack-xml_parser'
|
||||
|
||||
# To use debugger
|
||||
# to use debugger
|
||||
# gem 'ruby-debug'
|
||||
|
||||
# assets
|
||||
|
46
Gemfile.lock
@ -17,27 +17,27 @@ GEM
|
||||
remote: http://rubygems.org/
|
||||
specs:
|
||||
ZenTest (4.9.5)
|
||||
actionmailer (4.0.2)
|
||||
actionpack (= 4.0.2)
|
||||
actionmailer (4.0.3)
|
||||
actionpack (= 4.0.3)
|
||||
mail (~> 2.5.4)
|
||||
actionpack (4.0.2)
|
||||
activesupport (= 4.0.2)
|
||||
actionpack (4.0.3)
|
||||
activesupport (= 4.0.3)
|
||||
builder (~> 3.1.0)
|
||||
erubis (~> 2.7.0)
|
||||
rack (~> 1.5.2)
|
||||
rack-test (~> 0.6.2)
|
||||
actionpack-xml_parser (1.0.1)
|
||||
actionpack (>= 4.0.0.rc1)
|
||||
activemodel (4.0.2)
|
||||
activesupport (= 4.0.2)
|
||||
activemodel (4.0.3)
|
||||
activesupport (= 4.0.3)
|
||||
builder (~> 3.1.0)
|
||||
activerecord (4.0.2)
|
||||
activemodel (= 4.0.2)
|
||||
activerecord (4.0.3)
|
||||
activemodel (= 4.0.3)
|
||||
activerecord-deprecated_finders (~> 1.0.2)
|
||||
activesupport (= 4.0.2)
|
||||
activesupport (= 4.0.3)
|
||||
arel (~> 4.0.0)
|
||||
activerecord-deprecated_finders (1.0.3)
|
||||
activesupport (4.0.2)
|
||||
activesupport (4.0.3)
|
||||
i18n (~> 0.6, >= 0.6.4)
|
||||
minitest (~> 4.2)
|
||||
multi_json (~> 1.3)
|
||||
@ -51,7 +51,7 @@ GEM
|
||||
annotate (2.6.1)
|
||||
activerecord (>= 2.3.0)
|
||||
rake (>= 0.8.7)
|
||||
arel (4.0.1)
|
||||
arel (4.0.2)
|
||||
atomic (1.1.14)
|
||||
authlogic (3.3.0)
|
||||
activerecord (>= 3.2)
|
||||
@ -157,7 +157,7 @@ GEM
|
||||
nokogiri (1.6.1)
|
||||
mini_portile (~> 0.5.0)
|
||||
oauth (0.4.7)
|
||||
polyglot (0.3.3)
|
||||
polyglot (0.3.4)
|
||||
quiet_assets (1.0.2)
|
||||
railties (>= 3.1, < 5.0)
|
||||
rack (1.5.2)
|
||||
@ -167,19 +167,19 @@ GEM
|
||||
rack (>= 1.0)
|
||||
rack-utf8_sanitizer (1.1.0)
|
||||
rack (~> 1.0)
|
||||
rails (4.0.2)
|
||||
actionmailer (= 4.0.2)
|
||||
actionpack (= 4.0.2)
|
||||
activerecord (= 4.0.2)
|
||||
activesupport (= 4.0.2)
|
||||
rails (4.0.3)
|
||||
actionmailer (= 4.0.3)
|
||||
actionpack (= 4.0.3)
|
||||
activerecord (= 4.0.3)
|
||||
activesupport (= 4.0.3)
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 4.0.2)
|
||||
railties (= 4.0.3)
|
||||
sprockets-rails (~> 2.0.0)
|
||||
rails_autolink (1.1.5)
|
||||
rails (> 3.1)
|
||||
railties (4.0.2)
|
||||
actionpack (= 4.0.2)
|
||||
activesupport (= 4.0.2)
|
||||
railties (4.0.3)
|
||||
actionpack (= 4.0.3)
|
||||
activesupport (= 4.0.3)
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
rake (10.1.1)
|
||||
@ -228,7 +228,7 @@ GEM
|
||||
rack-protection (~> 1.4)
|
||||
tilt (~> 1.3, >= 1.3.4)
|
||||
spork (0.9.2)
|
||||
sprockets (2.10.1)
|
||||
sprockets (2.11.0)
|
||||
hike (~> 1.2)
|
||||
multi_json (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
@ -314,7 +314,7 @@ DEPENDENCIES
|
||||
nokogiri
|
||||
quiet_assets
|
||||
rack-utf8_sanitizer
|
||||
rails (= 4.0.2)
|
||||
rails (= 4.0.3)
|
||||
rails_autolink
|
||||
redis
|
||||
resque-scheduler (= 2.3.1)
|
||||
|
BIN
app/assets/images/channel_public_view.png
Normal file
After Width: | Height: | Size: 110 KiB |
@ -1,9 +1,12 @@
|
||||
$(document).ready(function() {
|
||||
// execute on window load (and not document.ready), so that the sidebar is positioned correctly
|
||||
$(window).load(function() {
|
||||
// if affix function exists
|
||||
if ($.fn.affix) {
|
||||
|
||||
// add sidebar affix
|
||||
$('#bootstrap-sidebar').affix();
|
||||
// add sidebar affix, wrapped in a timeout so that it displays correctly
|
||||
setTimeout(function() {
|
||||
$('#bootstrap-sidebar').affix();
|
||||
}, 100);
|
||||
|
||||
// add sidebar scrollspy
|
||||
$(document.body).scrollspy({ target: '#leftcol', offset: 300 });
|
||||
|
@ -29,6 +29,8 @@ body { padding-top: 70px; }
|
||||
.format-xml { display: none; }
|
||||
.format-block { min-height: 200px; }
|
||||
.format-block-lg { min-height: 350px; }
|
||||
.format-block-xl { min-height: 400px; }
|
||||
.format-block-xxl { min-height: 600px; }
|
||||
|
||||
|
||||
/* Sticky footer styles
|
||||
@ -70,7 +72,6 @@ body {
|
||||
.apps a:hover,
|
||||
.apps:hover div { text-decoration: none; }
|
||||
.commentarea { width: 300px; height: 80px; }
|
||||
#options { float: right; text-align: right; }
|
||||
#login {
|
||||
padding: 6px;
|
||||
border: 1px solid #bbbbbb;
|
||||
|
@ -7,6 +7,13 @@
|
||||
border: 1px solid #bbb;
|
||||
border-radius: 5px;
|
||||
padding: 2px 0;
|
||||
margin-top: 20px;
|
||||
width: 228px;
|
||||
}
|
||||
|
||||
#bootstrap-sidebar li a {
|
||||
padding: 2px 8px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
#bootstrap-sidebar li a:hover {
|
||||
@ -18,11 +25,23 @@
|
||||
border-right-width:4px;
|
||||
}
|
||||
|
||||
#bootstrap-sidebar li.subitem a {
|
||||
padding-left: 30px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@media (min-width: 979px) {
|
||||
#bootstrap-sidebar.affix-top, #bootstrap-sidebar.affix {
|
||||
position: fixed;
|
||||
top:90px;
|
||||
width:228px;
|
||||
width: 228px;
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 978px) {
|
||||
#bootstrap-sidebar.affix-top, #bootstrap-sidebar.affix {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,8 +33,15 @@ class ApplicationController < ActionController::Base
|
||||
@ssl_api_domain ||= ssl_api_domain
|
||||
@locale ||= get_locale
|
||||
I18n.locale = @locale
|
||||
|
||||
# sets timezone for current user, all DateTime outputs will be automatically formatted
|
||||
Time.zone = current_user.time_zone if current_user
|
||||
|
||||
# allows use of daily params
|
||||
params[:timescale] = '1440' if params[:timescale] == 'daily'
|
||||
params[:average] = '1440' if params[:average] == 'daily'
|
||||
params[:median] = '1440' if params[:median] == 'daily'
|
||||
params[:sum] = '1440' if params[:sum] == 'daily'
|
||||
end
|
||||
|
||||
# get the locale, but don't fail if header value doesn't exist
|
||||
@ -90,21 +97,12 @@ class ApplicationController < ActionController::Base
|
||||
return output.join(', ')
|
||||
end
|
||||
|
||||
def set_channels_menu
|
||||
@menu = 'channels'
|
||||
end
|
||||
|
||||
def set_apps_menu
|
||||
@menu = 'apps'
|
||||
end
|
||||
|
||||
def set_plugins_menu
|
||||
@menu = 'plugins'
|
||||
end
|
||||
|
||||
def set_devices_menu
|
||||
@menu = 'devices'
|
||||
end
|
||||
# set menus
|
||||
def set_support_menu; @menu = 'support'; end
|
||||
def set_channels_menu; @menu = 'channels'; end
|
||||
def set_apps_menu; @menu = 'apps'; end
|
||||
def set_plugins_menu; @menu = 'plugins'; end
|
||||
def set_devices_menu; @menu = 'devices'; end
|
||||
|
||||
def current_user_session
|
||||
return @current_user_session if defined?(@current_user_session)
|
||||
|
@ -29,10 +29,19 @@ class ChannelsController < ApplicationController
|
||||
|
||||
# list public channels
|
||||
def public
|
||||
@domain = domain
|
||||
# default blank response
|
||||
@channels = Channel.where(:id => 0).paginate :page => params[:page]
|
||||
|
||||
# get channels by ids
|
||||
if params[:channel_ids].present?
|
||||
flash[:notice] = t(:selected_channels)
|
||||
@channels = Channel.public_viewable.by_array(params[:channel_ids]).order('ranking desc, updated_at DESC').paginate :page => params[:page]
|
||||
# get channels that match a user
|
||||
elsif params[:username].present?
|
||||
flash[:notice] = "#{t(:user).capitalize}: #{params[:username]}"
|
||||
searched_user = User.find_by_login(params[:username])
|
||||
@channels = searched_user.channels.public_viewable.active.order('ranking desc, updated_at DESC').paginate :page => params[:page] if searched_user.present?
|
||||
# get channels that match a tag
|
||||
elsif params[:tag].present?
|
||||
flash[:notice] = "#{t(:tag).capitalize}: #{params[:tag]}"
|
||||
@ -40,6 +49,7 @@ class ChannelsController < ApplicationController
|
||||
# normal channel list
|
||||
else
|
||||
flash[:notice] = t(:featured_channels)
|
||||
respond_with_error(:error_resource_not_found) and return if params[:page] == '0'
|
||||
@channels = Channel.public_viewable.active.order('ranking desc, updated_at DESC').paginate :page => params[:page]
|
||||
end
|
||||
|
||||
@ -311,8 +321,12 @@ class ChannelsController < ApplicationController
|
||||
# if there is a talkback_key but no command
|
||||
respond_with_blank and return if params[:talkback_key].present? && command.blank?
|
||||
|
||||
# normal route, respond with the entry id of the feed
|
||||
render :text => status
|
||||
# normal route, respond with the feed
|
||||
respond_to do |format|
|
||||
format.html { render :text => status }
|
||||
format.json { render :json => feed.to_json }
|
||||
format.xml { render :xml => feed.to_xml(Feed.public_options) }
|
||||
end and return
|
||||
end
|
||||
|
||||
# import view
|
||||
|
@ -1,6 +1,43 @@
|
||||
class DocsController < ApplicationController
|
||||
before_filter :set_support_menu
|
||||
|
||||
def index; ;end
|
||||
def index; ; end
|
||||
def errors; ; end
|
||||
def tweetcontrol; ; end
|
||||
def plugins; ; end
|
||||
def importer; ; end
|
||||
def charts; ; end
|
||||
def users; ; end
|
||||
|
||||
def channels
|
||||
# default values
|
||||
@channel_api_key = 'XXXXXXXXXXXXXXXX'
|
||||
|
||||
# if user is signed in
|
||||
if current_user && current_user.channels.any?
|
||||
@channel_api_key = current_user.channels.order('updated_at desc').first.write_api_key
|
||||
end
|
||||
end
|
||||
|
||||
def thinghttp
|
||||
# default values
|
||||
@thinghttp_api_key = 'XXXXXXXXXXXXXXXX'
|
||||
|
||||
# if user is signed in
|
||||
if current_user && current_user.thinghttps.any?
|
||||
@thinghttp_api_key = current_user.thinghttps.order('updated_at desc').first.api_key
|
||||
end
|
||||
end
|
||||
|
||||
def thingtweet
|
||||
# default values
|
||||
@thingtweet_api_key = 'XXXXXXXXXXXXXXXX'
|
||||
|
||||
# if user is signed in
|
||||
if current_user && current_user.twitter_accounts.any?
|
||||
@thingtweet_api_key = current_user.twitter_accounts.order('updated_at desc').first.api_key
|
||||
end
|
||||
end
|
||||
|
||||
def talkback
|
||||
# default values
|
||||
|
@ -194,13 +194,13 @@ class FeedController < ApplicationController
|
||||
output = @feed.to_xml
|
||||
elsif params[:format] == 'csv'
|
||||
@csv_headers = Feed.select_options(@channel, params)
|
||||
elsif (params[:format] == 'txt' or params[:format] == 'text')
|
||||
elsif (params[:format] == 'txt' || params[:format] == 'text' || params[:format] == 'html')
|
||||
output = add_prepend_append(@feed["field#{params[:field_id]}"])
|
||||
else
|
||||
output = @feed.to_json
|
||||
|
||||
end
|
||||
# else set error code
|
||||
|
||||
# else set error code
|
||||
else
|
||||
if params[:format] == 'xml'
|
||||
output = bad_feed_xml
|
||||
@ -211,7 +211,7 @@ class FeedController < ApplicationController
|
||||
|
||||
# output data in proper format
|
||||
respond_to do |format|
|
||||
format.html { render :json => output }
|
||||
format.html { render :text => output }
|
||||
format.json { render :json => output, :callback => params[:callback] }
|
||||
format.xml { render :xml => output }
|
||||
format.csv
|
||||
|
@ -81,6 +81,11 @@ class Channel < ActiveRecord::Base
|
||||
cattr_reader :per_page
|
||||
@@per_page = 15
|
||||
|
||||
# write key for a channel
|
||||
def write_api_key
|
||||
self.api_keys.where(:write_flag => true).first.api_key
|
||||
end
|
||||
|
||||
# select options
|
||||
def select_options
|
||||
only = [:name, :created_at, :updated_at, :id, :last_entry_id]
|
||||
|
@ -33,6 +33,13 @@ class Feed < ActiveRecord::Base
|
||||
|
||||
attr_readonly :created_at
|
||||
|
||||
# for to_xml, return only the public attributes
|
||||
def self.public_options
|
||||
{
|
||||
:except => [:id, :updated_at]
|
||||
}
|
||||
end
|
||||
|
||||
# only output these fields for feed
|
||||
def self.select_options(channel, params)
|
||||
only = [:created_at]
|
||||
@ -96,7 +103,7 @@ class Feed < ActiveRecord::Base
|
||||
|
||||
# custom json output
|
||||
def as_json(options = {})
|
||||
super(options.merge(:except => [:updated_at, :id]))
|
||||
super(Feed.public_options)
|
||||
end
|
||||
|
||||
# check if a field value is a number
|
||||
|
@ -39,7 +39,7 @@
|
||||
<div id="sidebar_old">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="helplink">(<a target="_blank" href="http://community.thingspeak.com/documentation/api/#api_keys"><%= t(:help_options) %></a>)</div>
|
||||
<div class="helplink">(<a target="_blank" href="/docs/channels#api_keys"><%= t(:help_options) %></a>)</div>
|
||||
<h2><%= t(:help) %></h2>
|
||||
<%= t(:help_channel_write_key) %>
|
||||
<br /><br />
|
||||
|
@ -66,7 +66,7 @@
|
||||
|
||||
<h3>
|
||||
<%= t(:thingtweet) %>
|
||||
<div class="helplink">(<a href="http://community.thingspeak.com/documentation/apps/thingtweet/"><%= t(:help_options) %></a>)</div>
|
||||
<div class="helplink">(<a href="/docs/thingtweet/"><%= t(:help_options) %></a>)</div>
|
||||
</h3>
|
||||
<%= t(:help_apps_thingtweet) %>
|
||||
<ul>
|
||||
@ -77,7 +77,7 @@
|
||||
|
||||
<h3>
|
||||
<%= t(:thinghttp) %>
|
||||
<div class="helplink">(<a href="http://community.thingspeak.com/documentation/apps/thinghttp/"><%= t(:help_options) %></a>)</div>
|
||||
<div class="helplink">(<a href="/docs/thinghttp/"><%= t(:help_options) %></a>)</div>
|
||||
</h3>
|
||||
<%= t(:help_apps_thinghttp) %>
|
||||
<ul>
|
||||
@ -88,14 +88,14 @@
|
||||
|
||||
<h3>
|
||||
<%= t(:tweetcontrol) %>
|
||||
<div class="helplink">(<a href="http://community.thingspeak.com/documentation/apps/tweetcontrol/"><%= t(:help_options) %></a>)</div>
|
||||
<div class="helplink">(<a href="/docs/tweetcontrol"><%= t(:help_options) %></a>)</div>
|
||||
</h3>
|
||||
<%= t(:help_apps_tweetcontrol) %>
|
||||
<br><br>
|
||||
|
||||
<h3>
|
||||
<%= t(:react) %>
|
||||
<div class="helplink">(<a href="http://community.thingspeak.com/documentation/apps/react/"><%= t(:help_options) %></a>)</div>
|
||||
<div class="helplink">(<a href="/docs/react"><%= t(:help_options) %></a>)</div>
|
||||
</h3>
|
||||
<%= t(:help_apps_react) %>
|
||||
<br><br>
|
||||
|
@ -22,7 +22,7 @@
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<div class="helplink">(<a target="_blank" href="http://community.thingspeak.com/documentation/api/#send_data"><%= t(:help_options) %></a>)</div>
|
||||
<div class="helplink">(<a target="_blank" href="/docs/channels#update"><%= t(:help_options) %></a>)</div>
|
||||
<h2><%= t(:help_channel_update) %></h2>
|
||||
<%= t(:help_channel_post) %>
|
||||
<div class="code"><%= "#{@api_domain}update" %></div>
|
||||
@ -30,7 +30,7 @@
|
||||
<div class="code"><%= "#{@api_domain}update?key=#{@key}&field1=0" %></div>
|
||||
<br /><br />
|
||||
|
||||
<div class="helplink">(<a target="_blank" href="http://community.thingspeak.com/documentation/api/#view_data"><%= t(:help_options) %></a>)</div>
|
||||
<div class="helplink">(<a target="_blank" href="/docs/channels#get_feed"><%= t(:help_options) %></a>)</div>
|
||||
<h2><%= t(:help_channel_feed) %></h2>
|
||||
<%= t(:help_channel_view) %>
|
||||
<br />
|
||||
@ -40,7 +40,7 @@
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<div class="helplink">(<a target="_blank" href="http://community.thingspeak.com/documentation/#importer"><%= t(:help_options) %></a>)</div>
|
||||
<div class="helplink">(<a target="_blank" href="/docs/channels#importer"><%= t(:help_options) %></a>)</div>
|
||||
<h2><%= t(:help) %></h2>
|
||||
<%= t(:help_channel_import) %>
|
||||
</li>
|
||||
|
@ -66,7 +66,7 @@
|
||||
<div class="col-pad">
|
||||
|
||||
<%= t(:help_channel) %>
|
||||
(<a href="http://community.thingspeak.com/documentation/api/"><%= t(:help_options) %></a>)
|
||||
(<a href="/docs/channels"><%= t(:help_options) %></a>)
|
||||
<ul>
|
||||
<li><a href="http://community.thingspeak.com/tutorials/arduino/using-an-arduino-ethernet-shield-to-update-a-thingspeak-channel/">Arduino Tutorial</a></li>
|
||||
<li><a href="http://community.thingspeak.com/tutorials/netduino/create-your-own-web-of-things-using-the-netduino-plus-and-thingspeak/">Netduino Plus Tutorial</a></li>
|
||||
|
@ -1,11 +1,55 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12">
|
||||
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<h4 class="breadcrumb"><%= flash[:notice] %></h4>
|
||||
<%= render :partial => 'list' %>
|
||||
<br />
|
||||
<%= will_paginate @channels %>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-sm-3">
|
||||
<h4 class="breadcrumb"><%= t(:search).capitalize %></h4>
|
||||
|
||||
<div class="col-pad">
|
||||
<form role="form">
|
||||
<div class="form-group">
|
||||
<label for="tag_input"><%= t(:search_by_tag) %></label>
|
||||
<input type="text" class="form-control" id="tag_input" placeholder="<%= t(:search_input_tag) %>">
|
||||
</div>
|
||||
<button type="submit" id="search_tag" class="btn btn-primary btn-sm"><%= t(:submit) %></button>
|
||||
</form>
|
||||
|
||||
<br><br>
|
||||
|
||||
<form role="form">
|
||||
<div class="form-group">
|
||||
<label for="username_input"><%= t(:search_by_username) %></label>
|
||||
<input type="text" class="form-control" id="username_input" placeholder="<%= t(:search_input_username) %>">
|
||||
</div>
|
||||
<button type="submit" id="search_username" class="btn btn-primary btn-sm"><%= t(:submit) %></button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// when the document is ready
|
||||
$(document).ready(function() {
|
||||
|
||||
// when search tag is clicked
|
||||
$('#search_tag').on('click', function() {
|
||||
window.location.href = '<%= @domain %>channels/public?tag=' + encodeURIComponent($('#tag_input').val());
|
||||
return false;
|
||||
});
|
||||
|
||||
// when search username is clicked
|
||||
$('#search_username').on('click', function() {
|
||||
window.location.href = '<%= @domain %>channels/public?username=' + encodeURIComponent($('#username_input').val());
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -1,17 +1,15 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<div class="col-xs-12 col-sm-12">
|
||||
|
||||
<h4 class="breadcrumb"><%= t(:watched_channels) %></h4>
|
||||
|
||||
<div class="col-pad">
|
||||
<% if @channels.empty? %>
|
||||
<%= t(:watched_empty) %>
|
||||
<br /><br />
|
||||
<%= link_to t(:watched_find), public_channels_path %>
|
||||
<% else %>
|
||||
<%= render :partial => 'list' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if @channels.empty? %>
|
||||
<%= t(:watched_empty) %>
|
||||
<br /><br />
|
||||
<%= link_to t(:watched_find), public_channels_path %>
|
||||
<% else %>
|
||||
<%= render :partial => 'list' %>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
<% @channel.attribute_names.each do |attr| %>
|
||||
<% if attr.index('field') and @channel[attr] and !@channel[attr].empty? %>
|
||||
|
||||
|
||||
<%= render :partial => 'config',
|
||||
:locals => {
|
||||
:displayconfig => true,
|
||||
@ -35,7 +35,7 @@
|
||||
:height => @height
|
||||
}
|
||||
%>
|
||||
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
@ -43,7 +43,7 @@
|
||||
<div id="sidebar">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="helplink">(<a href="http://community.thingspeak.com/documentation/api/#charts"><%= t(:help_options) %></a>)</div>
|
||||
<div class="helplink">(<a href="/docs/charts"><%= t(:help_options) %></a>)</div>
|
||||
<h2><%= t(:help_charts) %></h2>
|
||||
<%= t(:help_charts_options) %>
|
||||
<br /><br />
|
||||
@ -64,3 +64,4 @@
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
40
app/views/docs/_sidebar.html.erb
Normal file
@ -0,0 +1,40 @@
|
||||
<ul class="nav nav-stacked" id="bootstrap-sidebar">
|
||||
|
||||
<li class="<%= 'active' if params[:action] == 'index' %>"><a href="/docs">Getting Started</a></li>
|
||||
|
||||
<% if params[:action] == 'channels' %>
|
||||
<li><a href="#channels">Channels</a></li>
|
||||
<li class="subitem"><a href="#keywords">Keywords</a></li>
|
||||
<li class="subitem"><a href="#urls">Base URLs</a></li>
|
||||
<li class="subitem"><a href="#api_keys">API Keys</a></li>
|
||||
<li class="subitem"><a href="#rate_limits">Rate Limits / Caching</a></li>
|
||||
<li class="subitem"><a href="#update">Update a Channel</a></li>
|
||||
<li class="subitem"><a href="#get_feed">Get Channel Feed</a></li>
|
||||
<li class="subitem"><a href="#get_field">Get Channel Field Feed</a></li>
|
||||
<li class="subitem"><a href="#get_status">Get Status Updates</a></li>
|
||||
<li class="subitem"><a href="#list_public">List Public Channels</a></li>
|
||||
<li class="subitem"><a href="#importer">Importer</a></li>
|
||||
<% else %>
|
||||
<li><a href="/docs/channels">Channels</a></li>
|
||||
<% end %>
|
||||
|
||||
<% if params[:action] == 'charts' %>
|
||||
<li><a href="#charts">Charts</a></li>
|
||||
<li class="subitem"><a href="#create">Create Charts</a></li>
|
||||
<li class="subitem"><a href="#embed">Embed Charts</a></li>
|
||||
<% else %>
|
||||
<li><a href="/docs/charts">Charts</a></li>
|
||||
<% end %>
|
||||
|
||||
<% if params[:action] == 'users' %>
|
||||
<li><a href="#users">Users</a></li>
|
||||
<li class="subitem"><a href="#get_user">Get User Information</a></li>
|
||||
<li class="subitem"><a href="#list_user_channels">List User's Channels</a></li>
|
||||
<% else %>
|
||||
<li><a href="/docs/users">Users</a></li>
|
||||
<% end %>
|
||||
|
||||
<li class="<%= 'active' if params[:action] == 'plugins' %>"><a href="/docs/plugins">Plugins</a></li>
|
||||
<li class="<%= 'active' if params[:action] == 'errors' %>"><a href="/docs/errors">Error Codes</a></li>
|
||||
</ul>
|
||||
|
127
app/views/docs/channels.html.erb
Normal file
@ -0,0 +1,127 @@
|
||||
<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="channels">Channels</h1>
|
||||
Channels are where your application stores and retrieves any type of data. Each channel has a Private View and a Public View. The Private View is only accessible by signing into your ThingSpeak.com user account. The Public View is what other viewers will see when they visit your ThingSpeak Channel. You can have different info on each view, customize the view with Plugins, and even disable the Public View. <br><br>
|
||||
<br><br>
|
||||
<%= image_tag 'channel_public_view.png', :size => '600x533' %>
|
||||
<br><br><br>
|
||||
Channel Views have the following features:
|
||||
<br><br>
|
||||
<ul>
|
||||
<li>Channel Watch</li>
|
||||
<li>Share via Social Networks</li>
|
||||
<li>Developer Info</li>
|
||||
<li>Ability to embed ThingSpeak Plugins</li>
|
||||
<li>Drag-and-drop Organization</li>
|
||||
<li>Tags</li>
|
||||
<li>Comments</li>
|
||||
</ul>
|
||||
<br><br>
|
||||
<h4>Channels API</h4>
|
||||
To read and write to a ThingSpeak Channel, your application must make requests to the ThingSpeak API using HTTP requests. Each ThingSpeak Channel allows for 8 fields of data (both numeric and alphanumeric formats), location information, and a status update. Each entry is stored with a date and time stamp and is assigned a unique Entry ID (entry_id). After the data is stored, you can retrieve the data by time selection or by Entry ID. In addition to storing and retrieving numeric and alphanumeric data, the ThingSpeak API allows for numeric data processing such as timescaling, averaging, median, summing, and rounding. The channel feeds supports JSON, XML, and CSV formats for integration into applications.
|
||||
<br><br>
|
||||
|
||||
<hr />
|
||||
<h2 id="keywords">Keywords</h2>
|
||||
Here are some keywords that are used in the API. An understanding of the terms will make the API documentation easier to understand.
|
||||
<br><br>
|
||||
<ul>
|
||||
<li><strong>Channel </strong>- The name for where data can be inserted or retrieved within the ThingSpeak API, identified by a numerical Channel ID</li>
|
||||
<li><strong>Channel ID </strong>- Every channel has a unique Channel ID. The Channel ID number is used to identify the channel when your application reads data from the channel</li>
|
||||
<li><strong>Field </strong>- One of eight specific locations for data inside of a channel, identified by a number between 1 to 8 – A field can store numeric data from sensors or alphanumeric strings from serial devices or RFID readers</li>
|
||||
<li><strong>Status </strong>- A short status message to augment the data stored in a channel</li>
|
||||
<li><strong>Location </strong>- The latitude, longitude, and elevation of where data is being sent from</li>
|
||||
<li><strong>Feed </strong>- The collective name for the data stored inside a channel, which may be any combination of field data, status updates, and location info</li>
|
||||
<li><strong>Write API Key</strong> – A 16 digit code that allows an application to write data to a channel</li>
|
||||
<li><strong>Read API Key</strong> – A 16 digit code that allows an application to read the data stored in a channel</li>
|
||||
</ul>
|
||||
<br><br>
|
||||
|
||||
<hr />
|
||||
<h2 id="urls">Base URL Addresses and Locations</h2>
|
||||
Regular URL:
|
||||
<br><br>
|
||||
<pre>http://api.thingspeak.com</pre>
|
||||
<br>
|
||||
Secure URL:
|
||||
<br><br>
|
||||
<pre>https://api.thingspeak.com</pre>
|
||||
<br>
|
||||
IP Address:
|
||||
<br><br>
|
||||
<pre>http://184.106.153.149</pre>
|
||||
<br>
|
||||
Cross-domain XML:
|
||||
<br><br>
|
||||
<pre>http://api.thingspeak.com/crossdomain.xml</pre>
|
||||
<br><br>
|
||||
|
||||
<hr />
|
||||
<h2 id="api_keys">API Keys</h2>
|
||||
<br><br>
|
||||
<h4>Private / Public Channels</h4>
|
||||
By default, your channel is private and requires a Read API Key to access its feed. You can make a channel public which gives other users the ability to use your feed without a Read API Key.
|
||||
<br><br><br>
|
||||
<h4>Write API Key</h4>
|
||||
In order to update a channel, you need to know your Write API Key. If your Write API Key gets compromised you can generate a new key.
|
||||
<br><br>
|
||||
Follow these steps to get your Write API Key:
|
||||
<br><br>
|
||||
<ul>
|
||||
<li>Select Channels</li>
|
||||
<li>Select the Channel to update</li>
|
||||
<li>Select Manage API Keys</li>
|
||||
</ul>
|
||||
<br><br>
|
||||
<h4>Read API Key</h4>
|
||||
The Read API Key allows your application to read data from the API. You can generate multiple Read API Keys for different applications.
|
||||
<br><br>
|
||||
Follow these steps to get a Read API Key:
|
||||
<br><br>
|
||||
<ul>
|
||||
<li>Select Channels</li>
|
||||
<li>Select the Channel to update</li>
|
||||
<li>Select Manage API Keys</li>
|
||||
<li>Select Generate New Read API Key</li>
|
||||
</ul>
|
||||
<br><br><br>
|
||||
|
||||
<hr />
|
||||
<h2 id="rate_limits">Rate Limits</h2>
|
||||
The open service via ThingSpeak.com has a rate limit of an update per channel every 15 seconds. This limit is so that the service can remain free and give everyone a high-level of service. The API source will also be made available on <a href="https://github.com/iobridge/ThingSpeak">GitHub</a> so that you can run this locally or via a shared web host provider. At that point you will be able to to tweak settings for your application requirements.
|
||||
<br><br>
|
||||
|
||||
<h4>Caching</h4>
|
||||
Caching is implemented on JSON and XML formats on feeds. Feeds that return more than 100 entries are cached for 5 minutes. This will allow great performance for popular applications. The Last API call and feeds that specify "results=100" or less are not cached, so that you can produce real-time applications.
|
||||
<br><br><br><br><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
<hr />
|
||||
<%= render 'docs/channels/update' %>
|
||||
|
||||
<hr />
|
||||
<%= render 'docs/channels/feed' %>
|
||||
|
||||
<hr />
|
||||
<%= render 'docs/channels/field' %>
|
||||
|
||||
<hr />
|
||||
<%= render 'docs/channels/status' %>
|
||||
|
||||
<hr />
|
||||
<%= render 'docs/channels/public_index' %>
|
||||
|
||||
<br><br>
|
||||
<hr />
|
||||
<%= render 'docs/channels/importer' %>
|
||||
|
||||
<br><br><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
305
app/views/docs/channels/_feed.html.erb
Normal file
@ -0,0 +1,305 @@
|
||||
<div>
|
||||
<%= render 'response' %>
|
||||
<h2 id="get_feed">Get a Channel Feed</h2>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
To view a Channel feed, send an HTTP GET to <code><%= @ssl_api_domain %>channels/<span class="customcode">CHANNEL_ID</span>/feeds<span class="format format-json">.json</span><span class="format format-xml">.xml</span></code> ,
|
||||
replacing <span class="customcode">CHANNEL_ID</span> with the ID of your Channel.
|
||||
|
||||
<br><br>
|
||||
Valid parameters:
|
||||
<ul>
|
||||
<li><b>key</b> (string) Read API Key for this specific Channel (optional--no key required for public channels)</li>
|
||||
<li><b>results</b> (integer) Number of entries to retrieve, 8000 max, default of 100 (optional)</li>
|
||||
<li><b>days</b> (integer) Days from now to include in feed (optional)</li>
|
||||
<li><b>start</b> (datetime) Start date in format YYYY-MM-DD%20HH:NN:SS (optional)</li>
|
||||
<li><b>end</b> (datetime) End date in format YYYY-MM-DD%20HH:NN:SS (optional)</li>
|
||||
<li><b>offset</b> (integer) Offset of your timezone without daylight savings time (optional)</li>
|
||||
<li><b>status</b> (true/false) Include status updates in feed by setting "status=true" (optional)</li>
|
||||
<li><b>location</b> (true/false) Include latitude, longitude, and elevation in feed by setting "location=true" (optional)</li>
|
||||
<li><b>min</b> (decimal) Minimum value to include in response (optional)</li>
|
||||
<li><b>max</b> (decimal) Maximum value to include in response (optional)</li>
|
||||
<li><b>round</b> (integer) Round to this many decimal places (optional)</li>
|
||||
<li><b>timescale</b> (integer or string) Get first value in this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily" (optional)</li>
|
||||
<li><b>sum</b> (integer or string) Get sum of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily" (optional)</li>
|
||||
<li><b>average</b> (integer or string) Get average of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily" (optional)</li>
|
||||
<li><b>median</b> (integer or string) Get median of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily" (optional)</li>
|
||||
<li><b>callback</b> (string) Function name to be used for JSONP cross-domain requests (optional)</li>
|
||||
</ul>
|
||||
|
||||
<div class="alert alert-warning">
|
||||
Please note that the results parameter is not compatible with timescale, sum, average, or median.
|
||||
</div>
|
||||
|
||||
<br>
|
||||
Example GET:
|
||||
|
||||
<pre>GET <span class="str"><%= @ssl_api_domain %>channels/<span class="customcode">9</span>/feeds<span class="format format-json">.json</span><span class="format format-xml">.xml</span>?results=<span class="customcode">2</span></span></pre>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="format format-block-xxl format-text">
|
||||
The response will be an HTML page with the JSON Channel feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"channel":
|
||||
{
|
||||
"id": 9,
|
||||
"name": "my_house",
|
||||
"description": "Netduino Plus connected to sensors around the house",
|
||||
"latitude": "40.44",
|
||||
"longitude": "-79.996",
|
||||
"field1": "Light",
|
||||
"field2": "Outside Temperature",
|
||||
"created_at": "2010-12-13T20:20:06-05:00",
|
||||
"updated_at": "2014-02-26T12:43:04-05:00",
|
||||
"last_entry_id": 6060625
|
||||
},
|
||||
"feeds":
|
||||
[
|
||||
{
|
||||
"created_at": "2014-02-26T12:42:49-05:00",
|
||||
"entry_id": 6060624,
|
||||
"field1": "188",
|
||||
"field2": "25.902335456475583"
|
||||
},
|
||||
{
|
||||
"created_at": "2014-02-26T12:43:04-05:00",
|
||||
"entry_id": 6060625,
|
||||
"field1": "164",
|
||||
"field2": "25.222929936305732"
|
||||
}
|
||||
]
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="format format-block-xxl format-json">
|
||||
The response will be a JSON object of the Channel feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"channel":
|
||||
{
|
||||
"id": 9,
|
||||
"name": "my_house",
|
||||
"description": "Netduino Plus connected to sensors around the house",
|
||||
"latitude": "40.44",
|
||||
"longitude": "-79.996",
|
||||
"field1": "Light",
|
||||
"field2": "Outside Temperature",
|
||||
"created_at": "2010-12-13T20:20:06-05:00",
|
||||
"updated_at": "2014-02-26T12:43:04-05:00",
|
||||
"last_entry_id": 6060625
|
||||
},
|
||||
"feeds":
|
||||
[
|
||||
{
|
||||
"created_at": "2014-02-26T12:42:49-05:00",
|
||||
"entry_id": 6060624,
|
||||
"field1": "188",
|
||||
"field2": "25.902335456475583"
|
||||
},
|
||||
{
|
||||
"created_at": "2014-02-26T12:43:04-05:00",
|
||||
"entry_id": 6060625,
|
||||
"field1": "164",
|
||||
"field2": "25.222929936305732"
|
||||
}
|
||||
]
|
||||
}
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="format format-block-xxl format-xml">
|
||||
The response will be an XML object of the Channel feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<channel>
|
||||
<id type="integer">9</id>
|
||||
<name>my_house</name>
|
||||
<description>Netduino Plus connected to sensors around the house</description>
|
||||
<latitude type="decimal">40.44</latitude>
|
||||
<longitude type="decimal">-79.996</longitude>
|
||||
<field1>Light</field1>
|
||||
<field2>Outside Temperature</field2>
|
||||
<created-at type="dateTime">2010-12-13T20:20:06-05:00</created-at>
|
||||
<updated-at type="dateTime">2014-02-26T12:49:19-05:00</updated-at>
|
||||
<last-entry-id type="integer">6060650</last-entry-id>
|
||||
<feeds type="array">
|
||||
<feed>
|
||||
<created-at type="dateTime">2014-02-26T12:49:04-05:00</created-at>
|
||||
<entry-id type="integer">6060649</entry-id>
|
||||
<field1>160</field1>
|
||||
<field2>25.307855626326962</field2>
|
||||
<id type="integer" nil="true"/>
|
||||
</feed>
|
||||
<feed>
|
||||
<created-at type="dateTime">2014-02-26T12:49:19-05:00</created-at>
|
||||
<entry-id type="integer">6060650</entry-id>
|
||||
<field1>171</field1>
|
||||
<field2>22.929936305732483</field2>
|
||||
<id type="integer" nil="true"/>
|
||||
</feed>
|
||||
</feeds>
|
||||
</channel>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
|
||||
Live examples:
|
||||
<ul>
|
||||
<li><a href="http://api.thingspeak.com/channels/9/feeds.json">http://api.thingspeak.com/channels/9/feeds.json</a></li>
|
||||
<li><a href="http://api.thingspeak.com/channels/9/feeds.json?median=10">http://api.thingspeak.com/channels/9/feeds.json?median=10</a></li>
|
||||
<li><a href="http://api.thingspeak.com/channels/9/feeds.json?start=2011-11-11%2010:10:10&end=2011-11-11%2011:11:11">http://api.thingspeak.com/channels/9/feeds.json?start=2011-11-11%2010:10:10&end=2011-11-11%2011:11:11</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
<div>
|
||||
<%= render 'response' %>
|
||||
<h2>Get Last Entry in a Channel Feed</h2>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
To get the last entry in a Channel feed, send an HTTP GET to <code><%= @ssl_api_domain %>channels/<span class="customcode">CHANNEL_ID</span>/feeds/last<span class="format format-json">.json</span><span class="format format-xml">.xml</span></code> ,
|
||||
replacing <span class="customcode">CHANNEL_ID</span> with the ID of your Channel.
|
||||
|
||||
<br><br>
|
||||
Valid parameters:
|
||||
<ul>
|
||||
<li><b>key</b> (string) Read API Key for this specific Channel (optional--no key required for public channels)</li>
|
||||
<li><b>offset</b> (integer) Offset of your timezone without daylight savings time (optional)</li>
|
||||
<li><b>status</b> (true/false) Include status updates in feed by setting "status=true" (optional)</li>
|
||||
<li><b>location</b> (true/false) Include latitude, longitude, and elevation in feed by setting "location=true" (optional)</li>
|
||||
<li><b>callback</b> (string) Function name to be used for JSONP cross-domain requests (optional)</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
Example GET:
|
||||
|
||||
<pre>GET <span class="str"><%= @ssl_api_domain %>channels/<span class="customcode">9</span>/feeds/last<span class="format format-json">.json</span><span class="format format-xml">.xml</span></span></pre>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="format format-block format-text">
|
||||
The response will be a JSON object of the most recent feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"created_at": "2014-02-26T21:27:21Z",
|
||||
"entry_id": 6061519,
|
||||
"field1": "176",
|
||||
"field2": "28.195329087048833"
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="format format-block format-json">
|
||||
The response will be a JSON object of the most recent feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"created_at": "2014-02-26T21:27:21Z",
|
||||
"entry_id": 6061519,
|
||||
"field1": "176",
|
||||
"field2": "28.195329087048833"
|
||||
}
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="format format-block format-xml">
|
||||
The response will be an XML object of the most recent feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed>
|
||||
<created-at type="dateTime">2014-02-26T21:28:51Z</created-at>
|
||||
<entry-id type="integer">6061525</entry-id>
|
||||
<field1>200</field1>
|
||||
<field2>28.365180467091296</field2>
|
||||
<id type="integer" nil="true"/>
|
||||
</feed>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<br><br>
|
||||
|
||||
<div>
|
||||
<%= render 'response' %>
|
||||
<h2>Get Specific Entry in a Channel</h2>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
To get a specific entry in a Channel's feed, send an HTTP GET to <code><%= @ssl_api_domain %>channels/<span class="customcode">CHANNEL_ID</span>/feeds/<span class="customcode">ENTRY_ID</span><span class="format format-json">.json</span><span class="format format-xml">.xml</span></code> ,
|
||||
replacing <span class="customcode">CHANNEL_ID</span> with the ID of your Channel and <span class="customcode">ENTRY_ID</span> with the ID of your entry.
|
||||
|
||||
<br><br>
|
||||
Valid parameters:
|
||||
<ul>
|
||||
<li><b>key</b> (string) Read API Key for this specific Channel (optional--no key required for public channels)</li>
|
||||
<li><b>offset</b> (integer) Offset of your timezone without daylight savings time (optional)</li>
|
||||
<li><b>status</b> (true/false) Include status updates in feed by setting "status=true" (optional)</li>
|
||||
<li><b>location</b> (true/false) Include latitude, longitude, and elevation in feed by setting "location=true" (optional)</li>
|
||||
<li><b>callback</b> (string) Function name to be used for JSONP cross-domain requests (optional)</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
Example GET:
|
||||
|
||||
<pre>GET <span class="str"><%= @ssl_api_domain %>channels/<span class="customcode">9</span>/feeds/<span class="customcode">6061519</span><span class="format format-json">.json</span><span class="format format-xml">.xml</span></span></pre>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="format format-block format-text">
|
||||
The response will be a JSON object of the feed entry, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"created_at": "2014-02-26T21:27:21Z",
|
||||
"entry_id": 6061519,
|
||||
"field1": "176",
|
||||
"field2": "28.195329087048833"
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="format format-block format-json">
|
||||
The response will be a JSON object of the feed entry, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"created_at": "2014-02-26T21:27:21Z",
|
||||
"entry_id": 6061519,
|
||||
"field1": "176",
|
||||
"field2": "28.195329087048833"
|
||||
}
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="format format-block format-xml">
|
||||
The response will be an XML object of the most recent feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed>
|
||||
<created-at type="dateTime">2014-02-26T21:27:21Z</created-at>
|
||||
<entry-id type="integer">6061519</entry-id>
|
||||
<field1>176</field1>
|
||||
<field2>28.195329087048833</field2>
|
||||
<id type="integer" nil="true"/>
|
||||
</feed>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
213
app/views/docs/channels/_field.html.erb
Normal file
@ -0,0 +1,213 @@
|
||||
<div>
|
||||
<%= render 'response' %>
|
||||
<h2 id="get_field">Get a Channel Field Feed</h2>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
To view a Channel's field feed, send an HTTP GET to <code><%= @ssl_api_domain %>channels/<span class="customcode">CHANNEL_ID</span>/fields/<span class="customcode">FIELD_ID</span><span class="format format-json">.json</span><span class="format format-xml">.xml</span></code> ,
|
||||
replacing <span class="customcode">CHANNEL_ID</span> with the ID of your Channel and <span class="customcode">FIELD_ID</span> with the ID of your field.
|
||||
|
||||
<br><br>
|
||||
Valid parameters:
|
||||
<ul>
|
||||
<li><b>key</b> (string) Read API Key for this specific Channel (optional--no key required for public channels)</li>
|
||||
<li><b>results</b> (integer) Number of entries to retrieve, 8000 max, default of 100 (optional)</li>
|
||||
<li><b>days</b> (integer) Days from now to include in feed (optional)</li>
|
||||
<li><b>start</b> (datetime) Start date in format YYYY-MM-DD%20HH:NN:SS (optional)</li>
|
||||
<li><b>end</b> (datetime) End date in format YYYY-MM-DD%20HH:NN:SS (optional)</li>
|
||||
<li><b>offset</b> (integer) Offset of your timezone without daylight savings time (optional)</li>
|
||||
<li><b>status</b> (true/false) Include status updates in feed by setting "status=true" (optional)</li>
|
||||
<li><b>location</b> (true/false) Include latitude, longitude, and elevation in feed by setting "location=true" (optional)</li>
|
||||
<li><b>min</b> (decimal) Minimum value to include in response (optional)</li>
|
||||
<li><b>max</b> (decimal) Maximum value to include in response (optional)</li>
|
||||
<li><b>round</b> (integer) Round to this many decimal places (optional)</li>
|
||||
<li><b>timescale</b> (integer or string) Get first value in this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily" (optional)</li>
|
||||
<li><b>sum</b> (integer or string) Get sum of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily" (optional)</li>
|
||||
<li><b>average</b> (integer or string) Get average of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily" (optional)</li>
|
||||
<li><b>median</b> (integer or string) Get median of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily" (optional)</li>
|
||||
<li><b>callback</b> (string) Function name to be used for JSONP cross-domain requests (optional)</li>
|
||||
</ul>
|
||||
|
||||
<div class="alert alert-warning">
|
||||
Please note that the results parameter is not compatible with timescale, sum, average, or median.
|
||||
</div>
|
||||
|
||||
<br>
|
||||
Example GET:
|
||||
|
||||
<pre>GET <span class="str"><%= @ssl_api_domain %>channels/<span class="customcode">9</span>/fields/<span class="customcode">1</span><span class="format format-json">.json</span><span class="format format-xml">.xml</span>?results=<span class="customcode">2</span></span></pre>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="format format-block-xxl format-text">
|
||||
The response will be an HTML page with the JSON Channel's field feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"channel":
|
||||
{
|
||||
"id": 9,
|
||||
"name": "my_house",
|
||||
"description": "Netduino Plus connected to sensors around the house",
|
||||
"latitude": "40.44",
|
||||
"longitude": "-79.996",
|
||||
"field1": "Light",
|
||||
"field2": "Outside Temperature",
|
||||
"created_at": "2010-12-13T20:20:06-05:00",
|
||||
"updated_at": "2014-02-26T12:43:04-05:00",
|
||||
"last_entry_id": 6060625
|
||||
},
|
||||
"feeds":
|
||||
[
|
||||
{
|
||||
"created_at": "2014-02-26T12:42:49-05:00",
|
||||
"entry_id": 6060624,
|
||||
"field1": "188"
|
||||
},
|
||||
{
|
||||
"created_at": "2014-02-26T12:43:04-05:00",
|
||||
"entry_id": 6060625,
|
||||
"field1": "164"
|
||||
}
|
||||
]
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="format format-block-xxl format-json">
|
||||
The response will be a JSON object of the Channel's field feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"channel":
|
||||
{
|
||||
"id": 9,
|
||||
"name": "my_house",
|
||||
"description": "Netduino Plus connected to sensors around the house",
|
||||
"latitude": "40.44",
|
||||
"longitude": "-79.996",
|
||||
"field1": "Light",
|
||||
"field2": "Outside Temperature",
|
||||
"created_at": "2010-12-13T20:20:06-05:00",
|
||||
"updated_at": "2014-02-26T12:43:04-05:00",
|
||||
"last_entry_id": 6060625
|
||||
},
|
||||
"feeds":
|
||||
[
|
||||
{
|
||||
"created_at": "2014-02-26T12:42:49-05:00",
|
||||
"entry_id": 6060624,
|
||||
"field1": "188"
|
||||
},
|
||||
{
|
||||
"created_at": "2014-02-26T12:43:04-05:00",
|
||||
"entry_id": 6060625,
|
||||
"field1": "164"
|
||||
}
|
||||
]
|
||||
}
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="format format-block-xxl format-xml">
|
||||
The response will be an XML object of the Channel's field feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<channel>
|
||||
<id type="integer">9</id>
|
||||
<name>my_house</name>
|
||||
<description>Netduino Plus connected to sensors around the house</description>
|
||||
<latitude type="decimal">40.44</latitude>
|
||||
<longitude type="decimal">-79.996</longitude>
|
||||
<field1>Light</field1>
|
||||
<field2>Outside Temperature</field2>
|
||||
<created-at type="dateTime">2010-12-13T20:20:06-05:00</created-at>
|
||||
<updated-at type="dateTime">2014-02-26T12:49:19-05:00</updated-at>
|
||||
<last-entry-id type="integer">6060650</last-entry-id>
|
||||
<feeds type="array">
|
||||
<feed>
|
||||
<created-at type="dateTime">2014-02-26T12:49:04-05:00</created-at>
|
||||
<entry-id type="integer">6060649</entry-id>
|
||||
<field1>160</field1>
|
||||
<id type="integer" nil="true"/>
|
||||
</feed>
|
||||
<feed>
|
||||
<created-at type="dateTime">2014-02-26T12:49:19-05:00</created-at>
|
||||
<entry-id type="integer">6060650</entry-id>
|
||||
<field1>171</field1>
|
||||
<id type="integer" nil="true"/>
|
||||
</feed>
|
||||
</feeds>
|
||||
</channel>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
<div>
|
||||
<%= render 'response' %>
|
||||
<h2>Get Last Entry in a Field Feed</h2>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
To get the last entry in a Channel's field feed, send an HTTP GET to <code><%= @ssl_api_domain %>channels/<span class="customcode">CHANNEL_ID</span>/fields/<span class="customcode">FIELD_ID</span>/last<span class="format format-json">.json</span><span class="format format-xml">.xml</span></code> ,
|
||||
replacing <span class="customcode">CHANNEL_ID</span> with the ID of your Channel and <span class="customcode">FIELD_ID</span> with the ID of your field.
|
||||
|
||||
<br><br>
|
||||
Valid parameters:
|
||||
<ul class="format-block">
|
||||
<li><b>key</b> (string) Read API Key for this specific Channel (optional--no key required for public channels)</li>
|
||||
<li><b>offset</b> (integer) Offset of your timezone without daylight savings time (optional)</li>
|
||||
<li><b>status</b> (true/false) Include status updates in feed by setting "status=true" (optional)</li>
|
||||
<li><b>location</b> (true/false) Include latitude, longitude, and elevation in feed by setting "location=true" (optional)</li>
|
||||
<li><b>callback</b> (string) Function name to be used for JSONP cross-domain requests (optional)</li>
|
||||
<li class="format format-text"><b>prepend</b> (string) Text to add before the API response (optional)</li>
|
||||
<li class="format format-text"><b>append</b> (string) Text to add after the API response (optional)</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
Example GET:
|
||||
|
||||
<pre>GET <span class="str"><%= @ssl_api_domain %>channels/<span class="customcode">9</span>/fields/<span class="customcode">1</span>/last<span class="format format-json">.json</span><span class="format format-xml">.xml</span></span></pre>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="format format-block format-text">
|
||||
The response will be the Channel field's most recent value, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
176
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="format format-block format-json">
|
||||
The response will be a JSON object of the most recent feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"created_at": "2014-02-26T21:27:21Z",
|
||||
"entry_id": 6061519,
|
||||
"field1": "176"
|
||||
}
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="format format-block format-xml">
|
||||
The response will be an XML object of the most recent feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed>
|
||||
<created-at type="dateTime">2014-02-26T21:28:51Z</created-at>
|
||||
<entry-id type="integer">6061525</entry-id>
|
||||
<field1>200</field1>
|
||||
<id type="integer" nil="true"/>
|
||||
</feed>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
8
app/views/docs/channels/_importer.html.erb
Normal file
@ -0,0 +1,8 @@
|
||||
<h2 id="importer">Importer</h2>
|
||||
|
||||
<p>Using the ThingSpeak Importer, you are able to import data from a CSV file directly into a ThingSpeak Channel. The access the Importer, select a <em>Channel</em>, and click <em>Import Data</em>.</p>
|
||||
<p>The format for the CSV should be the following:</p>
|
||||
<pre>datetime,field1,field2,field3,field4,field5,field6,field7,field8,latitude,longitude,elevation,status</pre>
|
||||
<p>Here is an example CSV file: <a title="ThingSpeak Import Sample Data" href="/files/importer_sample.csv" target="_blank">Sample CSV File</a></p>
|
||||
You only have to send a datetime stamp and at least one field. The datetime stamp can be in many formats such as epoch, ISO 8601, or MySQL time. If the datetime includes a GMT/UTC offset, we will use that to properly import the data. If your datetime stamps do not have a GMT / UTC offset, you can specify a time zone that the data was logged in.
|
||||
|
149
app/views/docs/channels/_public_index.html.erb
Normal file
@ -0,0 +1,149 @@
|
||||
<div>
|
||||
<%= render 'response' %>
|
||||
<h2 id="list_public">List Public Channels</h2>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
To view a list of public Channels, send an HTTP GET to
|
||||
<br>
|
||||
<code><%= @ssl_api_domain %>channels/public<span class="format format-json">.json</span><span class="format format-xml">.xml</span></code> .
|
||||
|
||||
<br><br>
|
||||
Valid parameters:
|
||||
<ul>
|
||||
<li><b>page</b> (integer) Page number to retrieve (optional)</li>
|
||||
<li><b>tag</b> (string) Name of tag to search for (optional)</li>
|
||||
<li><b>username</b> (string) Person's username that you want to search Channels for (optional)</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
Example GET:
|
||||
|
||||
<pre>GET <span class="str"><%= @ssl_api_domain %>channels/public<span class="format format-json">.json</span><span class="format format-xml">.xml</span></span></pre>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="format format-block-xxl format-text">
|
||||
The response will be a webpage with a <a href="/channels/public">list of public Channels</a>.
|
||||
</div>
|
||||
|
||||
<div class="format format-block-xxl format-json">
|
||||
The response will be a JSON object of public Channels, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"pagination":
|
||||
{
|
||||
"current_page": 1,
|
||||
"per_page": 15,
|
||||
"total_entries": 653
|
||||
},
|
||||
"channels":
|
||||
[
|
||||
{
|
||||
"id": 9,
|
||||
"name": "my_house",
|
||||
"description": "Netduino Plus connected to sensors around the house",
|
||||
"latitude": "40.44",
|
||||
"longitude": "-79.996",
|
||||
"created_at": "2010-12-13T20:20:06-05:00",
|
||||
"elevation": "",
|
||||
"last_entry_id": 6062691,
|
||||
"ranking" :100,
|
||||
"username":"hans",
|
||||
"tags":
|
||||
[
|
||||
{
|
||||
"id": 9,
|
||||
"name": "temp"
|
||||
},{
|
||||
"id": 25,
|
||||
"name": "light"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 5683,
|
||||
"name": "Residential Data Points",
|
||||
"description": "Arduino Uno + Ethernet Shield",
|
||||
"latitude": "35.664548",
|
||||
"longitude": "-78.654972",
|
||||
"created_at": "2013-05-15T12:33:57-04:00",
|
||||
"elevation": "100",
|
||||
"last_entry_id": 731713,
|
||||
"ranking": 100,
|
||||
"username": "samlro",
|
||||
"tags":
|
||||
[
|
||||
{
|
||||
"id": 950,
|
||||
"name": "Analog Inputs"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="format format-block-xxl format-xml">
|
||||
The response will be an XML object of public Channels, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<response>
|
||||
<pagination>
|
||||
<current-page type="WillPaginate::PageNumber">1</current-page>
|
||||
<per-page type="integer">15</per-page>
|
||||
<total-entries type="integer">654</total-entries>
|
||||
</pagination>
|
||||
<channels type="array">
|
||||
<channel>
|
||||
<id type="integer">9</id>
|
||||
<name>my_house</name>
|
||||
<description>
|
||||
Netduino Plus connected to sensors around the house
|
||||
</description>
|
||||
<latitude type="decimal">40.44</latitude>
|
||||
<longitude type="decimal">-79.996</longitude>
|
||||
<created-at type="dateTime">2010-12-13T20:20:06-05:00</created-at>
|
||||
<elevation/>
|
||||
<last-entry-id type="integer">6062720</last-entry-id>
|
||||
<ranking type="integer">100</ranking>
|
||||
<username>hans</username>
|
||||
<tags type="array">
|
||||
<tag>
|
||||
<id type="integer">9</id>
|
||||
<name>temp</name>
|
||||
</tag>
|
||||
<tag>
|
||||
<id type="integer">25</id>
|
||||
<name>light</name>
|
||||
</tag>
|
||||
</tags>
|
||||
</channel>
|
||||
<channel>
|
||||
<id type="integer">5683</id>
|
||||
<name>Residential Data Points</name>
|
||||
<description>Arduino Uno + Ethernet Shield</description>
|
||||
<latitude type="decimal">35.664548</latitude>
|
||||
<longitude type="decimal">-78.654972</longitude>
|
||||
<created-at type="dateTime">2013-05-15T12:33:57-04:00</created-at>
|
||||
<elevation>100</elevation>
|
||||
<last-entry-id type="integer">731720</last-entry-id>
|
||||
<ranking type="integer">100</ranking>
|
||||
<username>samlro</username>
|
||||
<tags type="array">
|
||||
<tag>
|
||||
<id type="integer">950</id>
|
||||
<name>Analog Inputs</name>
|
||||
</tag>
|
||||
</tags>
|
||||
</channel>
|
||||
</channels>
|
||||
</response>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
109
app/views/docs/channels/_status.html.erb
Normal file
@ -0,0 +1,109 @@
|
||||
<div>
|
||||
<%= render 'response' %>
|
||||
<h2 id="get_status">Get Status Updates</h2>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
To view a Channel's status updates, send an HTTP GET to <code><%= @ssl_api_domain %>channels/<span class="customcode">CHANNEL_ID</span>/status<span class="format format-json">.json</span><span class="format format-xml">.xml</span></code> ,
|
||||
replacing <span class="customcode">CHANNEL_ID</span> with the ID of your Channel.
|
||||
|
||||
<br><br>
|
||||
Valid parameters:
|
||||
<ul>
|
||||
<li><b>key</b> (string) Read API Key for this specific Channel (optional--no key required for public channels)</li>
|
||||
<li><b>offset</b> (integer) Offset of your timezone without daylight savings time (optional)</li>
|
||||
<li><b>callback</b> (string) Function name to be used for JSONP cross-domain requests (optional)</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
Example GET:
|
||||
|
||||
<pre>GET <span class="str"><%= @ssl_api_domain %>channels/<span class="customcode">1417</span>/status<span class="format format-json">.json</span><span class="format format-xml">.xml</span></span></pre>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="format format-block-xxl format-text">
|
||||
The response will be a JSON object of Channel statuses, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"channel":
|
||||
{
|
||||
"name": "CheerLights",
|
||||
"latitude": "40.5",
|
||||
"longitude": "-80.22"
|
||||
},
|
||||
"feeds":
|
||||
[
|
||||
{
|
||||
"created_at": "2014-02-26T02:28:01Z",
|
||||
"entry_id": 11888,
|
||||
"status": "@cheerlights green"
|
||||
},
|
||||
{
|
||||
"created_at": "2014-02-26T22:05:31Z",
|
||||
"entry_id" :11889,
|
||||
"status": "@cheerlights blue"
|
||||
}
|
||||
]
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="format format-block-xxl format-json">
|
||||
The response will be a JSON object of Channel statuses, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"channel":
|
||||
{
|
||||
"name": "CheerLights",
|
||||
"latitude": "40.5",
|
||||
"longitude": "-80.22"
|
||||
},
|
||||
"feeds":
|
||||
[
|
||||
{
|
||||
"created_at": "2014-02-26T02:28:01Z",
|
||||
"entry_id": 11888,
|
||||
"status": "@cheerlights green"
|
||||
},
|
||||
{
|
||||
"created_at": "2014-02-26T22:05:31Z",
|
||||
"entry_id" :11889,
|
||||
"status": "@cheerlights blue"
|
||||
}
|
||||
]
|
||||
}
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="format format-block-xxl format-xml">
|
||||
The response will be an XML object of Channel statuses, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<channel>
|
||||
<name>CheerLights</name>
|
||||
<latitude type="decimal">40.5</latitude>
|
||||
<longitude type="decimal">-80.22</longitude>
|
||||
<feeds type="array">
|
||||
<feed>
|
||||
<created-at type="dateTime">2014-02-26T02:28:01Z</created-at>
|
||||
<entry-id type="integer">11888</entry-id>
|
||||
<status>@cheerlights green</status>
|
||||
<id type="integer" nil="true"/>
|
||||
</feed>
|
||||
<feed>
|
||||
<created-at type="dateTime">2014-02-26T22:05:31Z</created-at>
|
||||
<entry-id type="integer">11889</entry-id>
|
||||
<status>@cheerlights blue</status>
|
||||
<id type="integer" nil="true"/>
|
||||
</feed>
|
||||
</feeds>
|
||||
</channel>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
99
app/views/docs/channels/_update.html.erb
Normal file
@ -0,0 +1,99 @@
|
||||
<div>
|
||||
<%= render 'response' %>
|
||||
<h2 id="update">Update a Channel</h2>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
To update a Channel, send an HTTP GET or POST to <code><%= @ssl_api_domain %>update<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) - Write API Key for this specific Channel (required). The Write API Key can optionally be sent via an X-THINGSPEAKAPIKEY HTTP header.</li>
|
||||
<li><b>field1</b> (string) - Field 1 data (optional)</li>
|
||||
<li><b>field2</b> (string) - Field 2 data (optional)</li>
|
||||
<li><b>field3</b> (string) - Field 3 data (optional)</li>
|
||||
<li><b>field4</b> (string) - Field 4 data (optional)</li>
|
||||
<li><b>field5</b> (string) - Field 5 data (optional)</li>
|
||||
<li><b>field6</b> (string) - Field 6 data (optional)</li>
|
||||
<li><b>field7</b> (string) - Field 7 data (optional)</li>
|
||||
<li><b>field8</b> (string) - Field 8 data (optional)</li>
|
||||
<li><b>lat</b> (decimal) - Latitude in degrees (optional)</li>
|
||||
<li><b>long</b> (decimal) - Longitude in degrees (optional)</li>
|
||||
<li><b>elevation</b> (integer) - Elevation in meters (optional)</li>
|
||||
<li><b>status</b> (string) - Status update message (optional)</li>
|
||||
<li><b>twitter</b> (string) - Twitter username linked to <a href="/docs/thingtweet">ThingTweet</a> (optional)</li>
|
||||
<li><b>tweet</b> (string) - Twitter status update (optional)</li>
|
||||
<li><b>created_at</b> (datetime) - Date when this feed entry was created, in the format<br>YYYY-MM-DD%20HH:NN:SS (optional)</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
Example POST:
|
||||
|
||||
<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"><%= @channel_api_key %></span>
|
||||
field1=<span class="customcode">73</span>
|
||||
</pre>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="format format-block-xl format-text">
|
||||
The response will be the entry ID of the update, for example: <code>18</code>
|
||||
<br><br>
|
||||
If the response is <code>0</code> then the update failed.
|
||||
</div>
|
||||
|
||||
<div class="format format-block-xl format-json">
|
||||
The response will be a JSON object of the new feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"channel_id": 3,
|
||||
"field1": "73",
|
||||
"field2": null,
|
||||
"field3": null,
|
||||
"field4": null,
|
||||
"field5": null,
|
||||
"field6": null,
|
||||
"field7": null,
|
||||
"field8": null,
|
||||
"created_at": "2014-02-25T14:13:01-05:00",
|
||||
"entry_id": 320,
|
||||
"status": null,
|
||||
"latitude": null,
|
||||
"longitude": null,
|
||||
"elevation": null,
|
||||
"location":null
|
||||
}
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="format format-block-xl format-xml">
|
||||
The response will be an XML object of the new feed, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feed>
|
||||
<channel-id type="integer">3</channel-id>
|
||||
<field1>73</field1>
|
||||
<field2 nil="true"/>
|
||||
<field3 nil="true"/>
|
||||
<field4 nil="true"/>
|
||||
<field5 nil="true"/>
|
||||
<field6 nil="true"/>
|
||||
<field7 nil="true"/>
|
||||
<field8 nil="true"/>
|
||||
<created-at type="dateTime">2014-02-25T14:15:42-05:00</created-at>
|
||||
<entry-id type="integer">321</entry-id>
|
||||
<status nil="true"/>
|
||||
<latitude type="decimal" nil="true"/>
|
||||
<longitude type="decimal" nil="true"/>
|
||||
<elevation nil="true"/>
|
||||
<location nil="true"/>
|
||||
</feed>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
89
app/views/docs/charts.html.erb
Normal file
@ -0,0 +1,89 @@
|
||||
<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="charts">Charts</h1>
|
||||
The Charts API allows you to create an instant visualization of your data. The chart displays properly in all modern browsers and mobile devices. The chart can also show dynamic data by loading new data automatically.
|
||||
<br><br>
|
||||
Use the Charts API to present numerical data stored in ThingSpeak Channels on charts. Supported chart types are line, bar, column, and step. Options include size, color, and labels.
|
||||
<br><br>
|
||||
|
||||
<hr />
|
||||
<h2 id="create">Creating a Chart</h2>
|
||||
|
||||
To create a chart, open the following URL, replacing <span class="customcode">CHANNEL_ID</span> and <span class="customcode">FIELD_ID</span> with values from one of your Channels.
|
||||
<br><br>
|
||||
<pre>http://api.thingspeak.com/channels/<span class="customcode">CHANNEL_ID</span>/charts/<span class="customcode">FIELD_ID</span></pre>
|
||||
|
||||
<br>
|
||||
Valid chart parameters:
|
||||
<ul>
|
||||
<li><b>title</b> (string) Chart title, default: Channel name (optional)</li>
|
||||
<li><b>xaxis</b> (string) Chart's x-axis label, default: "Date" (optional)</li>
|
||||
<li><b>yaxis</b> (string) Chart's y-axis label, default: field name (optional)</li>
|
||||
<li><b>color</b> (string) Line color, default: red (optional)</li>
|
||||
<li><b>bgcolor</b> (string) Background color, default: white (optional)</li>
|
||||
<li><b>type</b> (line/bar/column) Type of chart, default: line (optional)</li>
|
||||
<li><b>width</b> (integer) Chart width in pixels, iframe width will be 20px larger, default chart width: 400 (optional)</li>
|
||||
<li><b>height</b> (integer) Chart height in pixels, iframe height will be 20px larger, default chart height: 200 (optional)</li>
|
||||
<li><b>dynamic</b> (true/false) Make chart update automatically every 15 seconds, default: false (optional)</li>
|
||||
<li><b>step</b> (true/false) Draw chart as a step chart, default: false (optional)</li>
|
||||
<li><b>export</b> (true/false) Show export buttons, so that chart can be saved as an image, default: false (optional)</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
Valid feed parameters:
|
||||
<ul>
|
||||
<li><b>key</b> (string) Read API Key for this specific Channel (optional--no key required for public channels)</li>
|
||||
<li><b>results</b> (integer) Number of entries to retrieve, 8000 max, default of 100 (optional)</li>
|
||||
<li><b>days</b> (integer) Days from now to include in feed (optional)</li>
|
||||
<li><b>start</b> (datetime) Start date in format YYYY-MM-DD%20HH:NN:SS (optional)</li>
|
||||
<li><b>end</b> (datetime) End date in format YYYY-MM-DD%20HH:NN:SS (optional)</li>
|
||||
<li><b>offset</b> (integer) Offset of your timezone without daylight savings time (optional)</li>
|
||||
<li><b>status</b> (true/false) Include status updates in feed by setting "status=true" (optional)</li>
|
||||
<li><b>location</b> (true/false) Include latitude, longitude, and elevation in feed by setting "location=true" (optional)</li>
|
||||
<li><b>min</b> (decimal) Minimum value to include in response (optional)</li>
|
||||
<li><b>max</b> (decimal) Maximum value to include in response (optional)</li>
|
||||
<li><b>round</b> (integer) Round to this many decimal places (optional)</li>
|
||||
<li><b>timescale</b> (integer or string) Get first value in this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily" (optional)</li>
|
||||
<li><b>sum</b> (integer or string) Get sum of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily" (optional)</li>
|
||||
<li><b>average</b> (integer or string) Get average of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily" (optional)</li>
|
||||
<li><b>median</b> (integer or string) Get median of this many minutes, valid values: 10, 15, 20, 30, 60, 240, 720, 1440, "daily" (optional)</li>
|
||||
</ul>
|
||||
|
||||
<div class="alert alert-warning">
|
||||
Please note that the results parameter is not compatible with timescale, sum, average, or median.
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
<hr />
|
||||
<h2 id="embed">Embedding a Chart</h2>
|
||||
To place a ThingSpeak Chart on your webpage, use the Chart API as the source of an iframe.
|
||||
<br><br>
|
||||
Chart Embed Code:
|
||||
<br><br>
|
||||
<pre><iframe width="450" height="250" style="border: 1px solid #cccccc;" src="http://thingspeak.com/channels/<span class="customcode">CHANNEL_ID</span>/charts/<span class="customcode">FIELD_ID</span>"></iframe></pre>
|
||||
<br><br>
|
||||
Example Chart:
|
||||
<iframe width="100%" height="250" marginwidth="0" marginheight="0" scrolling="auto" frameborder="0" src="https://thingspeak.com/channels/3/charts/1?results=15"></iframe>
|
||||
|
||||
<br>
|
||||
<h4>Embedding a Dynamic Chart</h4>
|
||||
To place a dynamic ThingSpeak Chart on your webpage, use the Chart API as the source of an iframe and add the chart parameter ”dynamic=true”.
|
||||
<br><br>
|
||||
Chart Embed Code:
|
||||
<br><br>
|
||||
<pre><iframe width="450" height="250" style="border: 1px solid #cccccc;" src="http://thingspeak.com/channels/<span class="customcode">CHANNEL_ID</span>/charts/<span class="customcode">FIELD_ID</span>?dynamic=true"></iframe></pre>
|
||||
<br><br>
|
||||
Example Chart:
|
||||
<iframe width="100%" height="250" marginwidth="0" marginheight="0" scrolling="auto" frameborder="0" src="https://thingspeak.com/channels/9/charts/1?dynamic=true&results=15&title=Dynamic+Light+Levels"></iframe>
|
||||
<br><br><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
75
app/views/docs/errors.html.erb
Normal file
@ -0,0 +1,75 @@
|
||||
<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">
|
||||
|
||||
<div>
|
||||
<%= render 'response' %>
|
||||
<h2 id="errors">Error Codes</h2>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="table table-striped table-bordered table-condensed">
|
||||
<tr>
|
||||
<th><%= t(:error_code) %></th>
|
||||
<th><%= t(:error_http_status) %></th>
|
||||
<th><%= t(:error_message) %></th>
|
||||
<th><%= t(:error_details) %></th>
|
||||
</tr>
|
||||
|
||||
<% t(:error_codes).each do |key, values| %>
|
||||
<tr>
|
||||
<td><code><%= key %></code></td>
|
||||
<td><%= values[:http_status] %></td>
|
||||
<td><%= values[:message] %></td>
|
||||
<td><%= values[:details] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
</table>
|
||||
|
||||
<div>
|
||||
All errors will be sent with their corresponding <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes" target="_blank">HTTP status code</a>.
|
||||
<br><br>
|
||||
</div>
|
||||
|
||||
<div class="format format-block format-text">
|
||||
Example error response: <code>error_auth_required</code>
|
||||
</div>
|
||||
|
||||
<div class="format format-block format-json">
|
||||
The response will be a JSON error object, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"status": "401",
|
||||
"error":
|
||||
{
|
||||
"error_code": "error_auth_required",
|
||||
"message": "Authorization Required",
|
||||
"details": "Please make sure that your API key is correct."
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<div class="format format-block format-xml">
|
||||
The response will be an XML error object, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<error>
|
||||
<error-code>error_auth_required</error-code>
|
||||
<message>Authorization Required</message>
|
||||
<details>Please make sure that your API key is correct.</details>
|
||||
</error>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,4 +1,39 @@
|
||||
<div class="row">
|
||||
welcome
|
||||
|
||||
<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>Getting Started</h1>
|
||||
|
||||
<ul>
|
||||
<li>Sign Up for a New User Account - <a title="Create New ThingSpeak User Account" href="https://thingspeak.com/account/new">https://thingspeak.com/account/new</a></li>
|
||||
<li>Create a New Channel by selecting <em>Channels</em> and then <em>Create New Channel</em></li>
|
||||
<li>Follow a <a title="ThingSpeak Tutorials" href="http://community.thingspeak.com/tutorials/">tutorial</a> for common devices and applications</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
<h4>Support</h4>
|
||||
<p>Please post your questions, comments, and feature requests in the <a title="ThingSpeak Forum" href="http://community.thingspeak.com/forum/">ThingSpeak Forum</a>.</p>
|
||||
|
||||
<br><br>
|
||||
<h4>Open Source</h4>
|
||||
|
||||
<p>The ThingSpeak API is available on <a title="ThingSpeak Open Source Web of Things API on GitHub" href="https://github.com/iobridge/thingspeak" target="_blank">GitHub</a> and includes the complete ThingSpeak API for processing HTTP requests, storing numeric and alphanumeric data, numeric data processing, location tracking, and status updates. The open source version follows the same documentation as the ThingSpeak hosted service.</p>
|
||||
|
||||
<ul>
|
||||
<li><a title="Open Source Web of Things API - ThingSpeak on GitHub" href="https://github.com/iobridge/thingspeak" target="_blank">GitHub Repository for ThingSpeak</a></li>
|
||||
<li><a title="ThingSpeak GitHub Readme File" href="https://github.com/iobridge/thingspeak/blob/master/README.textile" target="_blank">ThingSpeak README and Setup Instructions</a></li>
|
||||
</ul>
|
||||
|
||||
<br><br>
|
||||
<h4>HTTP Headers</h4>
|
||||
If you would like to reduce the number of HTTP headers sent by our application, please add the parameter "headers=false" to any HTTP request.
|
||||
|
||||
<br><br><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
26
app/views/docs/plugins.html.erb
Normal file
@ -0,0 +1,26 @@
|
||||
<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>Plugins</h1>
|
||||
|
||||
Plugins are way to create your applications natively on the ThingSpeak platform. You can create applications using HTML, CSS, and JavaScript to create mashups of ThingSpeak services with other web services. Plugins can either be private or public. Private plugins can only be viewed from a private ThingSpeak Channel view. Public Plugins can be embedded on your website or added to a ThingSpeak Channel view.
|
||||
<br><br>
|
||||
|
||||
<hr />
|
||||
<h2>Example Plugin</h2>
|
||||
<p><a title="Display a Google Gauge Visualization using ThingSpeak Plugins" href="http://community.thingspeak.com/tutorials/google/display-a-google-gauge-visualization-using-thingspeak-plugins/">Display a Google Gauge Visualization using ThingSpeak Plugins</a> [<a title="Source ode for Google Gauge ThingSpeak Plugin" href="http://community.thingspeak.com/code/Google_Gauge.html">Source Code</a>]</p>
|
||||
|
||||
<p style="text-align: center;">
|
||||
<iframe width="100%" height="120" marginwidth="0" marginheight="0" scrolling="auto" frameborder="0" src="http://community.thingspeak.com/code/Google_Gauge.html"></iframe>
|
||||
</p>
|
||||
|
||||
<br><br><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
22
app/views/docs/users.html.erb
Normal file
@ -0,0 +1,22 @@
|
||||
<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="users">Users</h1>
|
||||
<br><br>
|
||||
|
||||
<hr />
|
||||
<%= render 'docs/users/show' %>
|
||||
|
||||
<hr />
|
||||
<%= render 'docs/users/user_channels' %>
|
||||
|
||||
<br><br><br><br><br><br><br><br><br><br><br><br>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
59
app/views/docs/users/_show.html.erb
Normal file
@ -0,0 +1,59 @@
|
||||
<div>
|
||||
<%= render 'response' %>
|
||||
<h2 id="get_user">Get User Information</h2>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
To get a user's information, send an HTTP GET to <code><%= @ssl_api_domain %>users/<span class="customcode">USERNAME</span><span class="format format-json">.json</span><span class="format format-xml">.xml</span></code> ,
|
||||
replacing <span class="customcode">USERNAME</span> with the person's username.
|
||||
|
||||
<br><br>
|
||||
Valid parameters:
|
||||
<ul>
|
||||
<li><b>api_key</b> (string) - User's API Key which, if provided, will show private information such as email addresses. (optional)</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
Example GET:
|
||||
|
||||
<pre>
|
||||
GET <span class="str"><%= @ssl_api_domain %>users/hans<span class="format format-json">.json</span><span class="format format-xml">.xml</span></span>
|
||||
</pre>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="format format-block format-text">
|
||||
The response will be a webpage with information about the user.
|
||||
</div>
|
||||
|
||||
<div class="format format-block format-json">
|
||||
The response will be a JSON object of the user, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"id": 4,
|
||||
"login": "hans",
|
||||
"created_at": "2010-12-03T09:17:52-05:00",
|
||||
"bio": "Web Developer @iobridge, @thingspeak",
|
||||
"website": "http://www.iamshadowlord.com"
|
||||
}
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="format format-block format-xml">
|
||||
The response will be an XML object of the user, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<user>
|
||||
<id type="integer">4</id>
|
||||
<login>hans</login>
|
||||
<created-at type="dateTime">2010-12-03T09:17:52-05:00</created-at>
|
||||
<bio>Web Developer @iobridge, @thingspeak</bio>
|
||||
<website>http://www.iamshadowlord.com</website>
|
||||
</user>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
136
app/views/docs/users/_user_channels.html.erb
Normal file
@ -0,0 +1,136 @@
|
||||
<div>
|
||||
<%= render 'response' %>
|
||||
<h2 id="list_user_channels">List User's Channels</h2>
|
||||
</div>
|
||||
|
||||
<br>
|
||||
To get a list of a user's Channels, send an HTTP GET to <code><%= @ssl_api_domain %>users/<span class="customcode">USERNAME</span>/channels<span class="format format-json">.json</span><span class="format format-xml">.xml</span></code> ,
|
||||
replacing <span class="customcode">USERNAME</span> with the person's username.
|
||||
|
||||
<br><br>
|
||||
Valid parameters:
|
||||
<ul>
|
||||
<li><b>api_key</b> (string) - User's API Key which, if provided, will also show private channels. (optional)</li>
|
||||
</ul>
|
||||
|
||||
<br>
|
||||
Example GET:
|
||||
|
||||
<pre>
|
||||
GET <span class="str"><%= @ssl_api_domain %>users/hans/channels<span class="format format-json">.json</span><span class="format format-xml">.xml</span></span>
|
||||
</pre>
|
||||
|
||||
<br>
|
||||
|
||||
<div class="format format-block-xl format-text">
|
||||
The response will be a webpage with a list of the user's Channels.
|
||||
</div>
|
||||
|
||||
<div class="format format-block-xl format-json">
|
||||
The response will be a JSON object of the user's Channels, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
{
|
||||
"channels":
|
||||
[
|
||||
{
|
||||
"id": 3,
|
||||
"name": "ioBridge Server",
|
||||
"description": "ioBridge IO-204 connected to web server",
|
||||
"latitude": null,
|
||||
"longitude": null,
|
||||
"created_at": "2010-12-03T09:26:23-05:00",
|
||||
"elevation": "",
|
||||
"last_entry_id": 163690,
|
||||
"ranking": 85,
|
||||
"username": "hans",
|
||||
"tags":
|
||||
[
|
||||
{
|
||||
"id": 24,
|
||||
"name": "temperature"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"name": "my_house",
|
||||
"description": "Netduino Plus connected to sensors around the house",
|
||||
"latitude": "40.44",
|
||||
"longitude": "-79.996",
|
||||
"created_at": "2010-12-13T20:20:06-05:00",
|
||||
"elevation": "",
|
||||
"last_entry_id": 6062844,
|
||||
"ranking": 100,
|
||||
"username": "hans",
|
||||
"tags":
|
||||
[
|
||||
{
|
||||
"id": 9,
|
||||
"name": "temp"
|
||||
},
|
||||
{
|
||||
"id": 25,
|
||||
"name": "light"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="format format-block-xl format-xml">
|
||||
The response will be an XML object of the user's Channels, for example:
|
||||
|
||||
<pre class="prettyprint">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<response>
|
||||
<channels type="array">
|
||||
<channel>
|
||||
<id type="integer">3</id>
|
||||
<name>ioBridge Server</name>
|
||||
<description>ioBridge IO-204 connected to web server</description>
|
||||
<latitude nil="true"/>
|
||||
<longitude nil="true"/>
|
||||
<created-at type="dateTime">2010-12-03T09:26:23-05:00</created-at>
|
||||
<elevation/>
|
||||
<last-entry-id type="integer">163690</last-entry-id>
|
||||
<ranking type="integer">85</ranking>
|
||||
<username>hans</username>
|
||||
<tags type="array">
|
||||
<tag>
|
||||
<id type="integer">24</id>
|
||||
<name>temperature</name>
|
||||
</tag>
|
||||
</tags>
|
||||
</channel>
|
||||
<channel>
|
||||
<id type="integer">9</id>
|
||||
<name>my_house</name>
|
||||
<description>Netduino Plus connected to sensors around the house</description>
|
||||
<latitude type="decimal">40.44</latitude>
|
||||
<longitude type="decimal">-79.996</longitude>
|
||||
<created-at type="dateTime">2010-12-13T20:20:06-05:00</created-at>
|
||||
<elevation/>
|
||||
<last-entry-id type="integer">6062860</last-entry-id>
|
||||
<ranking type="integer">100</ranking>
|
||||
<username>hans</username>
|
||||
<tags type="array">
|
||||
<tag>
|
||||
<id type="integer">9</id>
|
||||
<name>temp</name>
|
||||
</tag>
|
||||
<tag>
|
||||
<id type="integer">25</id>
|
||||
<name>light</name>
|
||||
</tag>
|
||||
</tags>
|
||||
</channel>
|
||||
</channels>
|
||||
</response>
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<a href="http://www.thingspeak.com/" title="Open Source Internet of Things">ThingSpeak.com</a> |
|
||||
<a href="http://community.thingspeak.com/" title="The ThingSpeak Blog covering the web of things">Blog</a> |
|
||||
<a href="http://community.thingspeak.com/forum/" title="Open discussion forum for ThingSpeak">Forum</a> |
|
||||
<a href="http://community.thingspeak.com/documentation/" title="ThingSpeak Documentation">Documentation</a> |
|
||||
<a href="/docs" title="ThingSpeak Documentation">Documentation</a> |
|
||||
<a href="http://community.thingspeak.com/tutorials/" title="Tutorials on how to use ThingSpeak web services">Tutorials</a> |
|
||||
<a href="http://feeds.feedburner.com/internetofthings" title="Internet of Things RSS Feed" target="_blank">RSS Feed</a>
|
||||
</span>
|
||||
|
@ -43,10 +43,10 @@
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
|
||||
<li class="dropdown">
|
||||
<li class="<%= "active " if @menu == 'support' %>dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><%=t(:support)%> <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="http://community.thingspeak.com/documentation/"><%= t(:documentation) %></a></li>
|
||||
<li><a href="/docs"><%= t(:documentation) %></a></li>
|
||||
<li><a href="http://community.thingspeak.com/tutorials/"><%= t(:tutorials) %></a></li>
|
||||
<li><a href="http://community.thingspeak.com/forum/"><%= t(:forum) %></a></li>
|
||||
</ul>
|
||||
|
@ -203,7 +203,7 @@
|
||||
<li><a href="http://www.twitter.com/thingspeak" title="Follow ThingSpeak on Twitter">Twitter</a></li>
|
||||
<li><a href="https://github.com/iobridge/ThingSpeak" title="Open Source Internet of Things Project on GitHub">GitHub</a></li>
|
||||
<li><a href="http://community.thingspeak.com" title="Join the ThingSpeak Community">ThingSpeak Community</a></li>
|
||||
<li><a href="http://community.thingspeak.com/documentation" title="ThingSpeak API and Apps Documentation">Documentation</a> and <a href="http://community.thingspeak.com/tutorials" title="ThingSpeak Tutorials">Tutorials</a></li>
|
||||
<li><a href="/docs" title="ThingSpeak API and Apps Documentation">Documentation</a> and <a href="http://community.thingspeak.com/tutorials" title="ThingSpeak Tutorials">Tutorials</a></li>
|
||||
<li><a href="mailto:support@thingspeak.com" title="Contact ThingSpeak">Questions</a></li>
|
||||
</ul>
|
||||
</p>
|
||||
|
@ -279,7 +279,12 @@ en:
|
||||
save: "Save"
|
||||
saved: "Saved."
|
||||
saved_error: "Error while saving data."
|
||||
search: "search"
|
||||
search_by_tag: "Search by tag"
|
||||
search_by_username: "Search by username"
|
||||
search_empty: "No search results were found."
|
||||
search_input_tag: "Enter tag"
|
||||
search_input_username: "Enter username"
|
||||
secure_signin: "Secure Sign In"
|
||||
select_file: "Please choose a file to upload."
|
||||
signin: "Sign In"
|
||||
|
@ -47,7 +47,8 @@ Thingspeak::Application.routes.draw do
|
||||
# specific feeds
|
||||
get 'channels/:channel_id/feed(s)(.:format)' => 'feed#index'
|
||||
get 'channels/:channel_id/field(s)/:field_id(.:format)' => 'feed#index'
|
||||
get 'channels/:channel_id/field(s)/:field_id/:id(.:format)' => 'feed#show'
|
||||
get 'channels/:channel_id/field/:field_id/:id(.:format)' => 'feed#show' # not sure why this doesn't work with (s)
|
||||
get 'channels/:channel_id/fields/:field_id/:id(.:format)' => 'feed#show' # not sure why this doesn't work with (s)
|
||||
get 'channels/:channel_id/feed(s)/last_average(.:format)' => 'feed#last_average'
|
||||
get 'channels/:channel_id/feed(s)/last_median(.:format)' => 'feed#last_median'
|
||||
get 'channels/:channel_id/feed(s)/last_sum(.:format)' => 'feed#last_sum'
|
||||
@ -159,8 +160,8 @@ Thingspeak::Application.routes.draw do
|
||||
end
|
||||
|
||||
# talkback api
|
||||
delete 'talkbacks/:id/commands', :to => 'commands#destroy_all'
|
||||
delete 'talkbacks/:id/commands/destroy_all', :to => 'commands#destroy_all'
|
||||
delete 'talkbacks/:talkback_id/commands', :to => 'commands#destroy_all'
|
||||
delete 'talkbacks/:talkback_id/commands/destroy_all', :to => 'commands#destroy_all'
|
||||
resources :talkbacks do
|
||||
resources :commands do
|
||||
collection do
|
||||
|
After Width: | Height: | Size: 26 KiB |
103
public/assets/application-270b79156b5690882822373ddc8f9201.css
Normal file
103
public/assets/application-2f2fb70d48fef2c28ab99bc9c8b10358.css
Normal file
BIN
public/assets/application-506f026d64a1c2a4dea9c83a9b717f54.js.gz
Normal file
BIN
public/assets/application-9b11a71e00be785ae478ca2c1abd490b.js.gz
Normal file
103
public/assets/application-ef64bf5dca3690cbfde3a17b34801823.css
Normal file
After Width: | Height: | Size: 110 KiB |
BIN
public/assets/eye-9175769cbdc94be2e5c44c59fdd3cbcd.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
public/assets/flag_gray-a465b55d9751d7d19801facf9d7d66b2.gif
Normal file
After Width: | Height: | Size: 983 B |
BIN
public/assets/flag_red-87843b96f6a35694691fd624cd68a802.gif
Normal file
After Width: | Height: | Size: 987 B |
BIN
public/assets/front-44d3070595f891d9a2d88e00606c6325.png
Normal file
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 618 B |
BIN
public/assets/icon_rss-2687cbed842e6291c3a7b431f7bad93e.gif
Normal file
After Width: | Height: | Size: 1008 B |
BIN
public/assets/icons/InfoBox-3dd7c57e5ed644dc9fa79014c10478ea.png
Executable file
After Width: | Height: | Size: 837 B |
BIN
public/assets/icons/Locked-dd04ba8d213caf20f92028729f7d652b.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 1.6 KiB |
BIN
public/assets/icons/delete-1b8201e6714e82d1b6343aaa53e6ac91.png
Executable file
After Width: | Height: | Size: 715 B |
After Width: | Height: | Size: 260 B |
After Width: | Height: | Size: 251 B |
After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 104 B |
After Width: | Height: | Size: 125 B |
After Width: | Height: | Size: 105 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 90 B |
After Width: | Height: | Size: 129 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 13 KiB |
BIN
public/assets/rails-8a98a69213c3e39ca47a4f822df62bfb.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
public/assets/shading-0b2c43248624209936e2bf318c546c16.png
Normal file
After Width: | Height: | Size: 565 B |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 1.6 KiB |
6
public/files/importer_sample.csv
Normal file
@ -0,0 +1,6 @@
|
||||
2011-04-05 15:00:00,240
|
||||
2011-04-05 15:10:00,244
|
||||
2011-04-05 15:20:00,257
|
||||
2011-04-05 15:30:00,245
|
||||
2011-04-05 15:40:00,252
|
||||
2011-04-05 15:50:00,253
|
|