The scripting engine for your iot projects
Build elegant applications that benefit from cloud scalability and javascript simplicity
Test it now
var http = require("http");
var ip = request.headers["x-forwarded-for"];
var iplookupUrl = "http://ip-api.com/json/" + ip;
var response = http.request({url: iplookupUrl});
if(response.status == "200"){
var result = JSON.parse(response.body);
var country = result.country;
if(!storage.local[country]){
storage.local[country] = {count :1}
}else{
storage.local[country].count += 1;
}
var message= "Thank you for tweeting from scriptr.io. There are now " + storage.local[country].count + " tweets from " + country +".";
var tweetResult = tweet(message);
return "You've just tweeted [" + message + "] from scriptr.io, you can check it <a href='http://twitter.com/scriptrdemo' target='_blank'>here</a>."
}else{
return "Ooops, we can't figure out your location!";
}
Click on one of the icons below to learn how to invoke the back-end script above from your favorite platform.
- Raspberry Pi](/content/developers#pi/index.html)
- Curl](/content/developers#curl/index.html)
- Kinoma](/content/developers#kinoma/index.html)
- Arduino](/content/developers#arduino/index.html)
import httplib, urllib
params = {}
headers = {"Content-type":"application/x-www-form-urlencoded","authorization":"bearer UThEOTkwNkY5OQ=="}
conn = httplib.HTTPSConnection("api.scriptrapps.io")
conn.request("POST","/welcome",params, headers)
response = conn.getresponse()
print response.status
print response.read()
curl -X POST -H 'Authorization: bearer UThEOTkwNkY5OQ==' 'https://api.scriptrapps.io/welcome'
<?xml version="1.0" encoding="utf-8"?>
<program xmlns="http://www.kinoma.com/kpr/1">
<script>
<![CDATA[
var url = "https://api.scriptrapps.io/welcome";
var container = new Container();
var containerBehavior = new Behavior();
containerBehavior.onComplete = function(container, message, data) {
trace("Response " + data);
};
container.behavior = containerBehavior;
var message = new Message(url);
message.method = "POST";
message.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
message.setRequestHeader("Content-Length", 0);
message.setRequestHeader("Authorization", "bearer UThEOTkwNkY5OQ==");
container.invoke(message, Message.TEXT);
]]>
</script>
</program>
#define SCRIPTR_ENDPOINT "api.scriptrapps.io"
#define SERVICE "scriptName"
#define TOKEN "XXXXXXXXXXyyyy=="
Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT, SPI_CLOCK_DIVIDER);
void loop(void)
{
Scriptr scriptr = Scriptr(SCRIPTR_ENDPOINT);
String response = "";
scriptr.invoke(cc3000, SERVICE, TOKEN, &response);
Serial.println(response);
delay(10000);
}
void setup(void)
{
Serial.begin(115200);
cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY);
cc3000.checkDHCP();
}
Click to add parameters What's this?
var http = require("http");
var iplookupUrl = "http://ip-api.com/json/" + request.headers["x-forwarded-for"];
var response = http.request({url: iplookupUrl});
if(response.status == "200"){
var result = JSON.parse(response.body);
var country = result.country;
var message = "Hello " + request.parameters["name"] + ", thank you for trying scriptr.io from " + country + ".";
var tweetResult= tweet(request.parameters["consumerKey"], request.parameters["consumerSecret"],request.parameters["accessToken"], request.parameters["accessTokenSecret"], message);
if(tweetResult.id_str){
return "You've just tweeted [" + message + "] from scriptr.io.";
}else{
return tweetResult;
}
}else{
return "Ooops, we can't figure out your location!";
}
The easiest way to build IoT applications
No hosting, no server management, no deployments, create your own APIs in minutes
Secure APIs
Communicate over SSL, and control access to your APIs through revocable keys.
Easily call any remote web service
Orchestrate & mashup third party web services into your scriptr.io APIs to use from your IOT device.
A simple url to call from anywhere
scriptr.io provides you with a simple and secure URL to call from any device or platform.
Features
Powerful Persistent Storage
Persist all your project's data into our easy to use and secure storage.
Push Notifications
Send notifications to any iOS or Android device through our easy to use Push Notifications API.
Scheduled Jobs
Schedule your scripts to run as background jobs on specific dates or recurring intervals.
Version Control
Connect your account to GitHub to benefit from its collaboration capabilities, version control and deployment management.
Publish/Subscribe
Allow your devices and scripts to exchange messages over public and private channels.
WebSockets
Allow your devices and scripts to communicate in a real-time fashion.
Hit the ground running
No need for infrastructure
scriptr.io takes away the pain of managing servers and allows you to concentrate on what matters the most: your product.
No need to learn a new language
with scriptr.io you can start coding right away with JavaScript.
Easy documentation and great support
scriptr.io has great documentation that will get you started in no time. Our support team is an email away and happy to help.