Skip to content

Instantly share code, notes, and snippets.

View grokify's full-sized avatar
👽
Going with it!

John Wang grokify

👽
Going with it!
View GitHub Profile
@grokify
grokify / rc_mms_filetypes_inbound.txt
Created May 5, 2017 23:10
RingCentral MMS File Types Inbound
application/gzip
application/rtf
application/zip
audio/mpeg
image/bmp
image/gif
image/jpeg
image/png
image/svg+xml
image/tiff
@grokify
grokify / rc_mms_filetypes_outbound.txt
Created May 5, 2017 23:09
RingCentral MMS File Types Outbound
application/gzip
application/rtf
application/zip
audio/mpeg
image/bmp
image/gif
image/jpeg
image/png
image/svg+xml
image/tiff
@grokify
grokify / lita-motionai.rb
Created March 14, 2017 12:46
Lita Motion AI Handler
module Lita
module Handlers
class Motionai < Handler
config :api_key, type: String, required: true
config :bot_id, type: Integer, required: true
route(/^\s*(.+)\s*/i, :anything, command: false, help: { 'listen' => 'Say anything and the bot will listen' })
def client
return @_client if @_client
@grokify
grokify / client.rb
Created March 14, 2017 12:37
Motion AI + Lita + Glip
def message_bot(params = {})
params[:key] = @api_key
params[:bot] = @bot_id
required = [:bot, :msg, :session, :key]
required.each do |param|
unless params.key? param
raise "Required param #{param} not present"
end
end
{
"records": [
{
"status": 200,
"body": {
"id": "000000001",
"name": "Avengers",
...
}
},
@grokify
grokify / WebSocket Note
Last active August 29, 2016 05:17
WebSocket Notes
require 'faye/websocket'
require 'eventmachine'
i = 0
EM.run {
ws = Faye::WebSocket::Client.new('ws://echo.websocket.org/')
ws.on :open do |event|
p [:open]
'<a href=rcmobile://call?number=' || REPLACE({phone}, ' ') || '>' || {phone} || '</a>'
@grokify
grokify / blog-2015-10-call-recording.php
Created August 15, 2016 07:53
RC Blog 2015-10 Call Recording API
$callLogRecords = $platform->get('/account/~/extension/~/call-log', array(
'type' => 'Voice',
'withRecording' => 'True'
))->json()->records;
foreach ($callLogRecords as $callLogRecord) {
// Retrieve recording media
$apiResponse = $platform->get($callLogRecord->recording->contentUri);
@grokify
grokify / rc-blog_2015-02_launch-sample.php
Created August 15, 2016 05:07
RC Blog 2015-02 Launch Hackathon
<?php
require('vendor/autoload.php');
use RC\core\cache\MemoryCache;
use RC\core\ajax\Request;
use RC\RCSDK;
#Initialize the SDK and authenticate
$rcsdk = new RCSDK(
new MemoryCache(),
'4XpQOskjdfhhYTkeIuQ',
{
"records" : [
{
"uri" : "https://platform.ringcentral.com/restapi/v1.0/account/1234567890/extension/1234567890/message-store/00000000001",
"id" : 111111111111,
"to" : [
{
"name" : "(650) 555-1212 (John Wang)"
}
],