Skip to content

Instantly share code, notes, and snippets.

View dzeitman's full-sized avatar

Dan Zeitman dzeitman

View GitHub Profile
'use strict';
module.exports = (context, cb) => {
console.log(context);
// post we use body
if(context.body.token != context.secrets.app_token){
const msg = 'Not authorized to use this service outside of our company slack channel';
cb(null,msg);
var request = require('request-promise');
module.exports = function(ctx, cb) {
var opts = {
uri: 'https://api.meetup.com/2/events.json',
qs:{
group_id: ctx.meta.group_id,
key: ctx.secrets.meetup_token,
},
json: true
@dzeitman
dzeitman / PubNubBlock-IBM-TONAL
Created March 15, 2017 00:17
IBM Tonal Analysis Block
export default (request) => {
const base64Codec = require('codec/base64');
const xhr = require('xhr');
const qs = require('codec/query_string');
const credentials = {
url: 'https://gateway.watsonplatform.net/tone-analyzer/api/v3/tone',
username: '<IBM USERNAME>',
password: '<IBM PASSWORD>'
@dzeitman
dzeitman / PubSub
Last active January 25, 2017 06:45
<!-- Include the PubNub Library -->
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.[version number].js"></script>
<!-- Instantiate PubNub -->
<script type="text/javascript">
var pubnubDemo = new PubNub({
publishKey: 'Your Publish Key Here',
subscribeKey: 'Your Subscribe Key Here'
});