horseman 0.0.3 → 0.0.4
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/Gemfile.lock +1 -1
- data/Rakefile +1 -1
- data/horseman.gemspec +1 -1
- data/lib/horseman/browser.rb +0 -5
- data/lib/horseman/connection.rb +1 -1
- data/lib/horseman/version.rb +1 -1
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
data/horseman.gemspec
CHANGED
data/lib/horseman/browser.rb
CHANGED
@@ -77,16 +77,12 @@ module Horseman
|
|
77
77
|
request['Content-Length'] = request.body ? request.body.length : 0
|
78
78
|
request['User-Agent'] = 'Horseman'
|
79
79
|
|
80
|
-
request.each_header {|k,v| puts "#{k}: #{v}"}
|
81
|
-
puts request.body
|
82
|
-
|
83
80
|
response = @connection.exec_request(request)
|
84
81
|
|
85
82
|
@cookies.update(response.get_fields('set-cookie'))
|
86
83
|
@last_action = Horseman::Action.new(@connection.uri, response)
|
87
84
|
|
88
85
|
code = response.code
|
89
|
-
puts code
|
90
86
|
|
91
87
|
if ['301','302','303','307'].include? code
|
92
88
|
raise "Redirect limit reached" if redirects >= MaxRedirects
|
@@ -95,7 +91,6 @@ module Horseman
|
|
95
91
|
if !is_absolute_url(redirect_url)
|
96
92
|
redirect_url = "#{@last_action.relative_root}#{redirect_url}"
|
97
93
|
end
|
98
|
-
puts redirect_url
|
99
94
|
get!(redirect_url, :redirects => redirects+1, :no_base_url => true)
|
100
95
|
end
|
101
96
|
end
|
data/lib/horseman/connection.rb
CHANGED
@@ -18,7 +18,7 @@ module Horseman
|
|
18
18
|
def build_request(options={})
|
19
19
|
self.url = options[:url] unless options[:url].nil?
|
20
20
|
|
21
|
-
puts "#{(options[:verb] || :get).to_s.upcase} #{options[:url] || 'none given'}"
|
21
|
+
#puts "#{(options[:verb] || :get).to_s.upcase} #{options[:url] || 'none given'}"
|
22
22
|
options[:verb] == (:get || nil) ? build_get_request : build_post_request(options[:body])
|
23
23
|
end
|
24
24
|
|
data/lib/horseman/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: horseman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-01-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
16
|
-
requirement: &
|
16
|
+
requirement: &70280819553360 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 1.5.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70280819553360
|
25
25
|
description: Headless HTTP crawler/scraper
|
26
26
|
email: peace.jarrod@gmail.com
|
27
27
|
executables: []
|