Skip to content

Instantly share code, notes, and snippets.

View felixkm's full-sized avatar

Felix Kollmar felixkm

View GitHub Profile
@felixkm
felixkm / counter.py
Created April 13, 2020 14:10
Counter Example for AWS IoT Greengrass on CloudRail.Box
# This Lambda function requires the AWS Greengrass SDK to run on Greengrass devices.
# This can be found on the AWS IoT Console.
import json
import greengrasssdk
# Creating a greengrass core sdk client
client = greengrasssdk.client("iot-data")
# Counter to keep track of invocations of the function_handler
let client = new IoTClient("<API Key>"); //unique key from config tool
let body = {
"temp": Math.random() //random value for testing
};
client.publish("my-device", "temperature", JSON.stringify(body), (err) => {
if(err) throw err;
console.log("Published successfully!");
});
CloudRail.setAppKey("Your CloudRail license key");
CloudStorage service;
Box box = new Box(
this,
"[Box Client Identifier]",
"[Box Client Secret]"
);
[CRCloudRail setAppKey:@"[Your CloudRail license key]"];
CRDropbox * service = [[CRDropbox alloc] initWithClientId:@"[Dropbox Client Identifier]"
clientSecret:@"[Dropbox Client Secret]"
redirectUri:@"https://auth.cloudrail.com/com.cloudrail.sample"
state:@"someState"];
// This service requires the advanced authentication method. Visit the tutorials page
// to learn more about the different authentication methods available or watch the video
// at https://youtu.be/phkYNAzDmhA.
CloudRail.setAppKey("[your CloudRail license key]");
Messaging service;
FacebookMessenger facebookmessenger = new FacebookMessenger(
null,
"[Bot Token]"
);
Line line = new Line(
const cloudrail = require("cloudrail-si");
cloudrail.Settings.setKey("[your CloudRail license key]");
let service;
const facebookmessenger = new cloudrail.services.FacebookMessenger(
null,
"[Bot Token]"
);
ICRCloudStorageProtocol service;
CRBox box = new CRBox(
"[Box Client Identifier]"
"[Box Client Secret]"
);
CROneDrive onedrive = new CROneDrive(
"[OneDrive Client Identifier]"
"[OneDrive Client Secret]"
ICloudStorage service;
Box box = new Box(
this,
"[Box Client Identifier]",
"[Box Client Secret]"
);
OneDrive onedrive = new OneDrive(
this,
CloudStorage service;
Box box = new Box(
new LocalReceiver(8082),
"[Box Client Identifier]",
"[Box Client Secret]",
"http://localhost:12345/auth",
"someState"
);
const cloudrail = require("cloudrail-si");
cloudrail.Settings.setKey("[Login to see your license key]");
let service;
const box = new cloudrail.services.Box(
cloudrail.RedirectReceivers.getLocalAuthenticator(8082),
"[Box Client Identifier]",
"[Box Client Secret]",
"http://localhost:12345/auth",