This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Angular 2</title> | |
<script src="https://unpkg.com/[email protected]/client/shim.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/dist/zone.js"></script> | |
<script src="https://unpkg.com/[email protected]/Reflect.js"></script> | |
<script src="https://unpkg.com/[email protected]/bundles/Rx.js"></script> | |
<script src="https://unpkg.com/@angular/core/bundles/core.umd.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (request) => { | |
const db = require('kvstore'); | |
var by = request.message.by || request.params.uuid; | |
var last_key = by + ":last_msg"; | |
var count_key = by + ":count"; | |
if (request.message && (request.message.text == '/my_stats')) { | |
// | |
// special "my_stats" command handling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Angular 2</title> | |
<script src="https://unpkg.com/[email protected]/client/shim.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/dist/zone.js"></script> | |
<script src="https://unpkg.com/[email protected]/Reflect.js"></script> | |
<script src="https://unpkg.com/[email protected]/bundles/Rx.js"></script> | |
<script src="https://unpkg.com/@angular/core/bundles/core.umd.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (request) => { | |
const pubnub = require('pubnub'); | |
var message = "Welcome, "; | |
var punctuation = "!"; | |
if (request.message.action == 'join') { | |
message = "Welcome, "; | |
punctuation = "!"; | |
} else if (request.message.action == 'timeout') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (request) => { | |
// NOTE: message metadata attributes are stored in `request.params.meta` | |
// NOTE: overall metadata attributes are stored in `request.meta` | |
// NOTE: message metadata attributes are a JSON string, read-write, but must be parsed/stringified to change | |
// NOTE: overall metadata attributes are read-only | |
if (request && request.params && request.params.meta) { | |
let attrs = JSON.parse(request.params.meta); | |
// to show attrs or request, uncomment: | |
// console.log(attrs); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Angular 2</title> | |
<script src="https://unpkg.com/[email protected]/client/shim.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/dist/zone.js"></script> | |
<script src="https://unpkg.com/[email protected]/Reflect.js"></script> | |
<script src="https://unpkg.com/[email protected]/bundles/Rx.js"></script> | |
<script src="https://unpkg.com/@angular/core/bundles/core.umd.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Angular 2</title> | |
<script src="https://unpkg.com/[email protected]/client/shim.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/dist/zone.js"></script> | |
<script src="https://unpkg.com/[email protected]/Reflect.js"></script> | |
<script src="https://unpkg.com/[email protected]/bundles/Rx.js"></script> | |
<script src="https://unpkg.com/@angular/core/bundles/core.umd.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (request) => { | |
const xhr = require('xhr'); | |
const base64 = require('codec/base64'); | |
const authToken = 'YOUR_AUTH_TOKEN'; | |
const url = "https://aiception.com/api/v2.1/detect_object"; | |
const httpOptions = { | |
"method": "POST", | |
"timeout": 10000, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Angular 2</title> | |
<script src="https://unpkg.com/[email protected]/client/shim.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/dist/zone.js"></script> | |
<script src="https://unpkg.com/[email protected]/Reflect.js"></script> | |
<script src="https://unpkg.com/[email protected]/bundles/Rx.js"></script> | |
<script src="https://unpkg.com/@angular/core/bundles/core.umd.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (request) => { | |
const xhr = require('xhr'); | |
const authKey = request.message.authKey; | |
const url = "https://api.wia.io/v1/events"; | |
const http_options = { | |
"method": "POST", | |
"headers": { | |
"Content-Type": "application/json", |