overlord 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/overlord/google_base.rb +10 -0
- data/overlord.gemspec +2 -2
- data/test/rails_root/test/unit/google_feed_request_test.rb +10 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.13
|
data/lib/overlord/google_base.rb
CHANGED
@@ -20,11 +20,21 @@ module Overlord
|
|
20
20
|
@referer
|
21
21
|
end
|
22
22
|
|
23
|
+
# userip: Ip address of user on whose behave a request is made. Helps reduce the chance that google will ban the server.
|
24
|
+
def self.user_ip=(val)
|
25
|
+
@userip = val
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.user_ip
|
29
|
+
@userip
|
30
|
+
end
|
31
|
+
|
23
32
|
# Add standard items to the google query
|
24
33
|
def self.build_google_query(query_options)
|
25
34
|
key = self.api_key_id || GlobalConfig.google_ajax_api_key rescue ''
|
26
35
|
query_options[:v] = '1.0'
|
27
36
|
query_options[:key] = key if key
|
37
|
+
query_options[:userip] = self.user_ip if self.user_ip
|
28
38
|
query_options
|
29
39
|
end
|
30
40
|
|
data/overlord.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{overlord}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.13"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Justin Ball", "Joel Duffin"]
|
12
|
-
s.date = %q{2010-01-
|
12
|
+
s.date = %q{2010-01-20}
|
13
13
|
s.description = %q{Code to interact with the google ajax apis on the server and the client.}
|
14
14
|
s.email = %q{justin@tatemae.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -46,6 +46,16 @@ class GoogleFeedRequestTest < ActiveSupport::TestCase
|
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
49
|
+
context "set userip as a paramter" do
|
50
|
+
setup do
|
51
|
+
Overlord::GoogleFeedRequest.user_ip = '64.12.50.151'
|
52
|
+
@query = Overlord::GoogleFeedRequest.build_google_query({:q => 'http://www.justinball.com'})
|
53
|
+
end
|
54
|
+
should "get entries from feed" do
|
55
|
+
assert !@query[:userip].blank?
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
49
59
|
context "load an array of feeds" do
|
50
60
|
setup do
|
51
61
|
@feeds = [ Factory(:feed, :uri => 'http://www.justinball.com/feed'), Factory(:feed, :uri => 'http://www.engadget.com/rss.xml'), Factory(:feed, :uri => 'http://www.example.com') ]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overlord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Ball
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-01-
|
13
|
+
date: 2010-01-20 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|