Skip to content

Instantly share code, notes, and snippets.

View alcabanillas-engh's full-sized avatar

Alvaro Cabanillas alcabanillas-engh

View GitHub Profile
require 'rubygems'
require 'simple-rss'
require 'open-uri'
require 'hpricot'
require 'couchrest'
require 'xmlsimple'
BASE_URI = 'http://www.sec.gov'
#Connect to our document database
SELECT PRS_REGION_ID, ENABLED FROM PRS_NPANXX_LOCATIONS WHERE NAME = :vLocalNPANXX
SELECT M.ANNOUNCEMENT, R.ENABLED FROM PRS_MESSAGES M, PRS_REGIONS R WHERE R.ID = :vREGION and R.PRS_MESSAGE_ID = M.ID
select name,phone from PRS_VIP where phone = :phone
[11/18/2008 02:20:24:791 PM] TID:[4152]
ENTER FUNCTION
TAction.DoSQLAction :: =
{
StrategyId: 39,
CallId: 3422,
QueryName: SelNPANXX,
ConnectionName: dbOraclePTools,
SQL: SELECT&bs;PRS_REGION_ID&cm;&bs;ENABLED&bs;FROM&bs;PRS_NPANXX_LOCATIONS&bs;WHERE&bs;NAME&bs;&is;&bs;&eq;vLocalNPANXX,
Params: vLocalNPANXX&is;vNPANXX,
Tue Nov 18 14:05:53 -0600 2008
Tue Nov 18 14:05:54 -0600 2008
GET /lookup_type=callerid&db=stjoe&callerid=unknown | Status: 200 | Params: {:database=>"db=stjoe", :lookup_key=>"callerid=unknown", :lookup_type=>"lookup_type=callerid", :format=>"html"}
Tue Nov 18 14:06:00 -0600 2008
Tue Nov 18 14:06:01 -0600 2008
GET /lookup_type=callerid&db=stjoe&callerid=unknown | Status: 200 | Params: {:database=>"db=stjoe", :lookup_key=>"callerid=unknown", :lookup_type=>"lookup_type=callerid", :format=>"html"}
Tue Nov 18 14:06:05 -0600 2008
Tue Nov 18 14:06:06 -0600 2008
require 'rubygems'
require 'simple-rss'
require 'open-uri'
require 'hpricot'
require 'couchrest'
require 'xmlsimple'
BASE_URI = 'http://www.sec.gov'
#Connect to our document database
{
"npanxx": {
"map": "function(doc) { emit(doc.npanxx, doc) }"
},
"all": {
"map": "function(doc) { emit(null, doc) }"
}
}
##Model
class NpaNxx
include DataMapper::Resource
property :id, String, :key => true, :field => :_id, :serial => true
property :rev, String, :field => :_rev
property :npanxx, String, :view => true
property :region, String
property :ocn, String
property :ratecenter, String
raw_response("EXEC SipAddHeader " +
"P-Asserted-Identity:" +
"#{service[:callerid_name]}<sip:#{service[:callerid_number]}@#{$config["from_domain"]}>")
require 'rubygems'
require 'net/http'
http = Net::HTTP.new('localhost', 4567)
path = '/call'
data = 'destination=14155551212&source=9998'
response, body = http.post(path, data)
puts response.inspect
puts body.inspect
require 'rubygems'
require 'digest'
require 'net/http'
require 'net/https'
require 'uri'
USER = '[email protected]'
PASS = 'test1234'
SECRET = 'supersecret'
CLIENT = 'MyClient'