Best Instagram Post Templates For Business

Blog. Type News Feed

people are loving 1 man in the crowd during lebron james history

:
Project Analysis Template
Added command-line client for quick-and-easy hook-to-script setup
1 parent New Arrival Product Poster commit d8a1bc0

People are loving 1 man in the crowd during lebron james history 3 files changed Add Photos And Videos To Your Blog

Lines changed: 105 additions & 1 deletion

Wie Sagt Man Purple Auf Deutsch Blog. Type News Feed

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
node-CloneAGC-hook
22
================
33

4-
This is a very simple, easy to use evented web hook for CloneAGC.
4+
This is a very simple, easy to use evented web hook API for CloneAGC. A command-line executable
5+
is also available.
56

67
To Install:
78
-----------
@@ -49,6 +50,38 @@ Available options are:
4950
* secret: if specified, you must use the same secret in your webhook configuration in CloneAGC. if a secret is specified, but one is not configured in CloneAGC, the hook will fail. if a secret is *not* specified, but one *is* configured in CloneAGC, the signature will not be validated and will be assumed to be correct. consider yourself warned.
5051
* logger: an optional instance of a logger that supports the "log" and "error" methods and one parameter for data (like console), default is to not log. mostly only for debugging purposes.
5152

53+
54+
Command-line
55+
-------------
56+
57+
Install it globally:
58+
59+
```bash
60+
$ npm install -g node-CloneAGC-hook
61+
```
62+
63+
Then you can run `CloneAGChook`:
64+
65+
```bash
66+
$ CloneAGChook --help
67+
68+
Usage:
69+
CloneAGChook [--host=HOST] [--port=PORT] [--callback=URL_PATH] [--secret=SECRET] [--verbose] <trigger> <script>
70+
71+
Options:
72+
73+
--host=HOST Address to listen on
74+
--port=PORT Port to listen on
75+
--callback=URL_PATH The callback URL path
76+
--secret=SECRET The secret you use the in the CloneAGC webhook config
77+
--verbose Log to console
78+
--version Output the version number
79+
-h, --help Output usage information
80+
```
81+
82+
Default values for options are same as for the API (see above).
83+
84+
5285
License
5386
=======
5487

bin/CloneAGChook

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#!/usr/bin/env node
2+
3+
var child_process = require('child_process'),
4+
docopt = require('docopt'),
5+
multiline = require('multiline'),
6+
path = require('path');
7+
8+
var CloneAGChook = require('../');
9+
10+
11+
var doc = multiline(function() {/*
12+
13+
Usage:
14+
CloneAGChook [--host=HOST] [--port=PORT] [--callback=URL_PATH] [--secret=SECRET] [--verbose] <trigger> <script>
15+
16+
Options:
17+
18+
--host=HOST Address to listen on
19+
--port=PORT Port to listen on
20+
--callback=URL_PATH The callback URL path
21+
--secret=SECRET The secret you use the in the CloneAGC webhook config
22+
--verbose Log to console
23+
--version Output the version number
24+
-h, --help Output usage information
25+
26+
*/});
27+
28+
29+
var options = docopt.docopt(doc, {
30+
version: require('../package.json').version,
31+
help: true,
32+
options_first: false,
33+
exit: true
34+
});
35+
36+
37+
var CloneAGC = CloneAGChook({
38+
host: options['--host'],
39+
port: options['--port'] ? parseInt(options['--port']) : null,
40+
path: options['--callback'],
41+
secret: options['--secret'],
42+
logger: options['--verbose'] ? console : null,
43+
});
44+
45+
// start it!
46+
CloneAGC.listen();
47+
48+
// trigger
49+
CloneAGC.on(options['<trigger>'], function () {
50+
var scriptPath = path.resolve(options['<script>']);
51+
52+
child_process.execFile(scriptPath, function(err, stdout, stderr) {
53+
if (options['--verbose']) {
54+
console.log('--> EXEC ' + scriptPath);
55+
56+
if (err) {
57+
console.error(err.stack);
58+
} else {
59+
console.error(stderr);
60+
console.log(stdout);
61+
}
62+
63+
console.log('--- END ' + scriptPath);
64+
}
65+
});
66+
});
67+

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,9 @@
88
"devDependencies": {
99
"jshint": "^2.5.1",
1010
"precommit-hook": "^1.0.2"
11+
},
12+
"dependencies": {
13+
"docopt": "^0.6.2",
14+
"multiline": "^1.0.2"
1115
}
1216
}

Whriting Post Blog. Type News Feed

Comments
 (0)