Skip to content

Instantly share code, notes, and snippets.

def show
puts Benchmark.measure {
method_1()
}
puts Benchmark.measure {
method_2()
}
puts Benchmark.measure {
method_3()
}
require 'net/http'
class Bot
def post(data, speech)
data['STIMULUS'] = speech
data['sub'] = 'Say'
response = Net::HTTP.post_form(
URI.parse('http://jabberwacky.icogno.com/webserviceform-joan'),
def get_response(html)
html.chomp!
start_index = html.index('Begin Response !-->') +
'Begin Response !-->'.length
end_index = html.index('<!-- End Response')
result = html[start_index, end_index - start_index]
while (result.index('}'))
result = result[result.index('}') + 1,
class Bot
def start_conversation
def post(data, speech)
end
var U='whbshrvpchfkrm';
var U = U.replace(/h/g,'e').replace('k','o').replace('p','i');
//whbshrvpchfkrm => webserviceform
if('joan' != '') U+='-'+'joan';
@gavingmiller
gavingmiller / api-discovery.rb
Last active July 6, 2024 21:33
api discovery
def post()
response = Net::HTTP.post_form(
URI.parse('http://jabberwacky.icogno.com/webserviceform-joan'),
this_was_my_response_to_Joan
)
return response.body
end
var U = 'whbshrvpchfkrm';
var U = U.replace(/h/g,'e').replace('k','o').replace('p','i');
sT(f,m) => window.setTimeout(f,m)
gE(e) => document.getElementById(e)
iH(e,h) => document.getElementById(e).innerHTML = h
T=true;
F=false;
@gavingmiller
gavingmiller / fetch.rb
Created July 1, 2024 14:32
Joan Source
def GetSource
url = URI.parse('http://www.icogno.com/')
request = Net::HTTP::Get.new(url.path)
response = Net::HTTP.start(url.host, url.port) {|http|
http.request(request)
}
return response.body
end