factual-api 1.3.8 → 1.3.9
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/lib/factual.rb +19 -17
- data/lib/factual/api.rb +5 -5
- data/lib/factual/query/facets.rb +0 -2
- data/lib/factual/query/geocode.rb +0 -2
- data/lib/factual/query/geopulse.rb +0 -2
- data/lib/factual/query/match.rb +0 -2
- data/lib/factual/query/resolve.rb +0 -2
- data/lib/factual/query/table.rb +0 -2
- data/lib/factual/write/clear.rb +0 -2
- data/lib/factual/write/flag.rb +0 -2
- data/lib/factual/write/insert.rb +0 -2
- data/lib/factual/write/submit.rb +0 -2
- metadata +2 -3
- data/lib/factual/query/monetize.rb +0 -24
data/CHANGELOG.md
CHANGED
data/lib/factual.rb
CHANGED
@@ -1,20 +1,26 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
gem 'oauth'
|
3
3
|
|
4
|
+
require 'json'
|
5
|
+
require 'cgi'
|
6
|
+
require 'timeout'
|
7
|
+
|
4
8
|
require 'oauth'
|
5
|
-
|
6
|
-
require 'factual/
|
7
|
-
require 'factual/query/
|
8
|
-
require 'factual/query/
|
9
|
-
require 'factual/query/
|
10
|
-
require 'factual/query/
|
11
|
-
require 'factual/query/
|
12
|
-
require 'factual/query/
|
13
|
-
require 'factual/
|
14
|
-
require 'factual/write/
|
15
|
-
require 'factual/write/
|
16
|
-
require 'factual/write/
|
17
|
-
require 'factual/
|
9
|
+
|
10
|
+
require File.expand_path('../factual/api', __FILE__)
|
11
|
+
require File.expand_path('../factual/query/base', __FILE__)
|
12
|
+
require File.expand_path('../factual/query/table', __FILE__)
|
13
|
+
require File.expand_path('../factual/query/facets', __FILE__)
|
14
|
+
require File.expand_path('../factual/query/match', __FILE__)
|
15
|
+
require File.expand_path('../factual/query/resolve', __FILE__)
|
16
|
+
require File.expand_path('../factual/query/geocode', __FILE__)
|
17
|
+
require File.expand_path('../factual/query/geopulse', __FILE__)
|
18
|
+
require File.expand_path('../factual/write/base', __FILE__)
|
19
|
+
require File.expand_path('../factual/write/flag', __FILE__)
|
20
|
+
require File.expand_path('../factual/write/submit', __FILE__)
|
21
|
+
require File.expand_path('../factual/write/clear', __FILE__)
|
22
|
+
require File.expand_path('../factual/write/insert', __FILE__)
|
23
|
+
require File.expand_path('../factual/multi', __FILE__)
|
18
24
|
|
19
25
|
class Factual
|
20
26
|
def initialize(key, secret, options = {})
|
@@ -32,10 +38,6 @@ class Factual
|
|
32
38
|
Query::Facets.new(@api, "t/#{table_id_or_alias}")
|
33
39
|
end
|
34
40
|
|
35
|
-
def monetize
|
36
|
-
Query::Monetize.new(@api)
|
37
|
-
end
|
38
|
-
|
39
41
|
def match(values)
|
40
42
|
Query::Match.new(@api, :values => values)
|
41
43
|
end
|
data/lib/factual/api.rb
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
require 'json'
|
2
|
-
require 'cgi'
|
3
|
-
require 'timeout'
|
4
|
-
|
5
1
|
class Factual
|
6
2
|
class API
|
7
|
-
VERSION = "1.3.
|
3
|
+
VERSION = "1.3.9"
|
8
4
|
API_V3_HOST = "api.v3.factual.com"
|
9
5
|
DRIVER_VERSION_TAG = "factual-ruby-driver-v" + VERSION
|
10
6
|
PARAM_ALIASES = { :search => :q, :sort_asc => :sort }
|
@@ -116,6 +112,10 @@ class Factual
|
|
116
112
|
elapsed_time = (Time.now - start_time) * 1000
|
117
113
|
debug(url, method, headers, body, res, elapsed_time) if @debug_mode
|
118
114
|
|
115
|
+
if res.code == '301' && res['location']
|
116
|
+
res = make_request(res['location'])
|
117
|
+
end
|
118
|
+
|
119
119
|
res
|
120
120
|
end
|
121
121
|
|
data/lib/factual/query/facets.rb
CHANGED
data/lib/factual/query/match.rb
CHANGED
data/lib/factual/query/table.rb
CHANGED
data/lib/factual/write/clear.rb
CHANGED
data/lib/factual/write/flag.rb
CHANGED
data/lib/factual/write/insert.rb
CHANGED
data/lib/factual/write/submit.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: factual-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-09-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: oauth
|
@@ -75,7 +75,6 @@ files:
|
|
75
75
|
- lib/factual/query/geocode.rb
|
76
76
|
- lib/factual/query/geopulse.rb
|
77
77
|
- lib/factual/query/match.rb
|
78
|
-
- lib/factual/query/monetize.rb
|
79
78
|
- lib/factual/query/resolve.rb
|
80
79
|
- lib/factual/query/table.rb
|
81
80
|
- lib/factual/write/base.rb
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'factual/query/base'
|
2
|
-
|
3
|
-
class Factual
|
4
|
-
module Query
|
5
|
-
class Monetize < Base
|
6
|
-
VALID_PARAMS = [
|
7
|
-
:filters, :search, :geo,
|
8
|
-
:limit, :offset
|
9
|
-
]
|
10
|
-
|
11
|
-
def initialize(api, params = {})
|
12
|
-
@path = "places/monetize"
|
13
|
-
@action = :read
|
14
|
-
super(api, params)
|
15
|
-
end
|
16
|
-
|
17
|
-
VALID_PARAMS.each do |param|
|
18
|
-
define_method(param) do |*args|
|
19
|
-
self.class.new(@api, @params.merge(param => form_value(args)))
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|