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
// init library and start | |
function init(url, title) { | |
g.url = url; | |
g.title = title||"Cj Client"; | |
req(g.url,"get"); | |
} | |
// primary loop | |
function parseCj() { | |
dump(); |
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
// Initialize WebHooks module. | |
var WebHooks = require('node-webhooks') | |
var webHooks = new WebHooks({db: './webHooksDB.json'}) // json file that store webhook URLs | |
// sync instantation - add a new webhook called 'shortname1' | |
webHooks.add('shortname1', 'http://www.webapp.com/resources/shortname1').then(function(){ | |
// done | |
}).catch(function(err){console.log(err)}) | |
// add another webHook |
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
<alps> | |
<doc>Simple Banking Example</doc> | |
<!-- actions --> | |
<descriptor id="getList" type="safe" /> | |
<descriptor id="getStatus" type="safe" /> | |
<descriptor id="updateStatus" type="idempotent"> | |
<descriptor href="#accountId" /> | |
<descriptor href="#actionStatus" /> | |
</descriptor> | |
<descriptor id="updatePreferences" type="idempotent"> |
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
{ | |
"collection" : { | |
"links" : [ | |
{ | |
"rel" : "ext", | |
"href" : "https://github.com/collection-json/extensions/blob/master/link-with-accepts.md", | |
"name" : "accepts-extension", | |
"render" : "none" | |
} | |
] |
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
// function passes token+context to claims store | |
function customerResource(request, response) { | |
var token = request.headers.authorization; | |
var body = request.body; | |
var method = request.method; | |
var url = request.url; | |
if(checkClaims(url, method, token.payload)===true) { | |
response = updateRecord("customer", body) |
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
<alps version="1.0"> | |
<doc>Hypertext Command Line Interface (HCLI) semantics.</doc> | |
<descriptor id="hcli-document"> | |
<descriptor href="#hcli_version" /> | |
<descriptor href="#name" /> | |
<descriptor id="section" type="semantic"> | |
<descriptor href="#name" /> |
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
{ | |
collection: { | |
version: "1.0", | |
href: "//api.example.org/", | |
title: "Long List of Stuff", | |
properties: { | |
current-page: "3", | |
page-count: "1001", | |
item-count: "15034" | |
}, |
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
{ | |
"collection": { | |
"version": "1.0", | |
"href": "//herokuapp.com/task/", | |
"title": "TPS - Tasks", | |
"links": [...], | |
"items": [ | |
{ | |
"rel": "item", | |
"href": "//herokuapp.com/task/1l9fz7bhaho", |
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
<alps> | |
<doc>ALPS search w/ varying network promises for the same named action</doc> | |
<!-- data --> | |
<descriptor id="text" type="semantic" /> | |
<descriptor id="url" type="semantic" /> | |
<!-- actions --> | |
<descriptor id="form" name="search" type="safe" rt="results"> | |
<descriptor href="#text" name="value"/> |
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
<alps> | |
<doc>varying values for @rt</doc> | |
<!-- data --> | |
<descriptor id="value" type="semantic" /> | |
<descriptor id="title" type="semantic" /> | |
<descriptor id="id" type="semantic" /> | |
<descriptor id="code" type="semantic" /> | |
<descriptor id="url" type="semantic" /> | |
<descriptor id="waitsec" type="semantic" /> |