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
application/gzip | |
application/rtf | |
application/zip | |
audio/mpeg | |
image/bmp | |
image/gif | |
image/jpeg | |
image/png | |
image/svg+xml | |
image/tiff |
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
application/gzip | |
application/rtf | |
application/zip | |
audio/mpeg | |
image/bmp | |
image/gif | |
image/jpeg | |
image/png | |
image/svg+xml | |
image/tiff |
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
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 |
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
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 |
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
{ | |
"records": [ | |
{ | |
"status": 200, | |
"body": { | |
"id": "000000001", | |
"name": "Avengers", | |
... | |
} | |
}, |
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
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] |
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
'<a href=rcmobile://call?number=' || REPLACE({phone}, ' ') || '>' || {phone} || '</a>' |
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
$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); |
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
<?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', |
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
{ | |
"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)" | |
} | |
], |