Class: Tweethook
- Inherits:
-
Object
show all
- Defined in:
- lib/tweethook.rb
Defined Under Namespace
Classes: Post, Result, Search
Class Method Summary
collapse
Class Method Details
.get(path, *params) ⇒ Object
30
31
32
33
34
35
|
# File 'lib/tweethook.rb', line 30
def self.get(path,*params)
params = params.empty? ? nil : params.first
response = Typhoeus::Request.get(Tweethook.url(path), :params => params)
return nil if response.code.eql?(403)
result = JSON.parse(response.body)
end
|
.password ⇒ Object
16
17
18
|
# File 'lib/tweethook.rb', line 16
def self.password
ENV['TWEETHOOK_API_PASS']
end
|
.post(path, params) ⇒ Object
24
25
26
27
28
|
# File 'lib/tweethook.rb', line 24
def self.post(path,params)
response = Typhoeus::Request.post(Tweethook.url(path),
:params => params)
response.body.empty? ? nil : JSON.parse(response.body)
end
|
.signature ⇒ Object
20
21
22
|
# File 'lib/tweethook.rb', line 20
def self.signature
ENV['TWEETHOOK_SIGNATURE']
end
|
.user ⇒ Object
12
13
14
|
# File 'lib/tweethook.rb', line 12
def self.user
ENV['TWEETHOOK_API_USER']
end
|