Forked from Captain Anonymous's Pen WrwyJQ.
A Pen by Stephen Blum on CodePen.
| (ns pubnub | |
| (:require [ clojure.data.json :as json ]) | |
| (:require [ clojure.string :as str ]) | |
| (:require [ clj-sockets.core :as sock ]) | |
| (:require [ clojure.core.async :as async ]) | |
| (:require [ org.httpkit.client :as http ]) | |
| (:import [ java.net URLEncoder ])) | |
| ;; =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
| ;; Declaring |
| #!/usr/bin/python | |
| # server | |
| # python https.py | |
| # | |
| # browser | |
| # https://0.0.0.0:4443 | |
| import BaseHTTPServer | |
| import SimpleHTTPServer |
Forked from Captain Anonymous's Pen WrwyJQ.
A Pen by Stephen Blum on CodePen.
| function process(request){ | |
| var XHR = require("xhr"); | |
| var r = XHR.get("https://alchemy.p.mashape.com/text/TextGetTextSentiment", | |
| {"query-params": { | |
| "outputMode":"json", | |
| "showSourceText":false, | |
| "text":request.message.text, | |
| "mashape-key":" -- YOUR MASHAPE KEY HERE -- " |
Authenticate with an email and password to receive a session_token.
The Session Token will be a top level key called token.
The Session Token token is used for all requests after authentication.
You also receive a user_id which is used in your apps and keys lookup.
| <!-- include tiny sdk --> | |
| <script src="pubnub-tiny.js"></script> | |
| <!-- usage example --> | |
| <script> | |
| // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
| // Initiate | |
| // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= | |
| var ref = subscribe({ | |
| subkey : 'YOUR_SUBSCRIBE_KEY_HERE' |
| export default (request) => { | |
| const xhr = require('xhr') | |
| const pub_key = 'demo' // YOUR 2nd PUBLISH KEY | |
| const sub_key = 'demo' // YOUR 2nd SUBSCRIBE KEY | |
| const chncopy = request.channels[0] | |
| const msgcopy = JSON.stringify(request.message) | |
| const url = "http://pubsub.pubnub.com/publish/" + [ | |
| pub_key, sub_key, 0, chncopy, 0, msgcopy | |
| ].join('/') | |
Create ML profiles of companies and developers to collect delightful messages for leads.
A tweet that started this: https://twitter.com/stephenlb/status/784220325173080064
| function hash( key, seed ) { | |
| var seed = seed || 5381; | |
| var len = Buffer.byteLength(key, 'utf8'); | |
| var data = key; | |
| var nblocks = len / 16; | |
| var h1 = seed; | |
| var h2 = seed; | |
| var h3 = seed; | |
| var h4 = seed; |
| import pubnub#pubnub==4.0.2 | |
| import time | |
| from pubnub.pnconfiguration import PNConfiguration | |
| from pubnub.pubnub import PubNub | |
| pnconf = PNConfiguration() | |
| pnconf.subscribe_key = "demo" | |
| pnconf.publish_key = "demo" | |
| pubnub = PubNub(pnconf) |