Initial work

This commit is contained in:
erwanlr
2013-02-20 17:34:17 +01:00
parent a01e1ab29f
commit 8b9aec468a
11 changed files with 26 additions and 78 deletions

View File

@@ -60,7 +60,7 @@ module WpUsernames
end
def get_nickname_from_url(url)
resp = Browser.instance.get(url, { follow_location: true, max_redirects: 2 })
resp = Browser.instance.get_and_follow_location(url)
nickname = nil
if resp.code == 200
nickname = extract_nickname_from_body(resp.body)

View File

@@ -55,7 +55,7 @@ class WpEnumerator
targets.each do |target|
url = target.get_full_url
request = enum_browser.forge_request(url, { cache_timeout: 0, follow_location: true })
request = enum_browser.forge_request(url, { cache_ttl: 0, followlocation: true })
request_count += 1
request.on_complete do |response|

View File

@@ -74,7 +74,7 @@ class WpTheme < WpItem
# Discover the wordpress theme name by parsing the css link rel
def self.find_from_css_link(target_uri)
response = Browser.instance.get(target_uri.to_s, { follow_location: true, max_redirects: 2 })
response = Browser.instance.get_and_follow_location(target_uri.to_s)
# https + domain is optional because of relative links
matches = %r{(?:https?://[^"']+)?/([^/]+)/themes/([^"']+)/style.css}i.match(response.body)