Writing a generic plugin | ThingSpeak Plugins | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Writing a generic plugin
No permission to create posts
July 16, 2014
3:19 pm
Avatar
Resseguie
New Member
Members
Forum Posts: 2
Member Since:
July 16, 2014
sp_UserOfflineSmall Offline

I'm interested in writing a generic / reusable plugin for Thingspeak. But all the examples I've seen are hard coded to call the API with a specific channel ID (and API_KEY if required) to get the feed data. Is there a way for the plugin to get the "current" channel who's page it's installed on?

July 16, 2014
4:05 pm
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

Hi,

I just wrote a simple plugin that should allow you to get the channel ID depending on the channel page it exists on: https://thingspeak.com/plugins/4482 . Just view-source, and you should see the JavaScript code that should help you out.

lee

July 17, 2014
2:23 pm
Avatar
Resseguie
New Member
Members
Forum Posts: 2
Member Since:
July 16, 2014
sp_UserOfflineSmall Offline

Makes sense, thanks. Any thoughts on private channels that would require an API key?

July 17, 2014
2:33 pm
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

It's a little more complicated, but you could extract the API keys from a JSON list of your channels. Please see "List My Channels" under the documentation here: https://thingspeak.com/docs/channels#index .

lee

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

celinabw2, FitoSprayscroma, LunnonGor, lancevl16, bernicenk60, veronicadq18

Administrators: Hans: 387, lee: 457