lib/kindle_highlights/kindle_highlight.rb in kindle-highlights-0.0.6 vs lib/kindle_highlights/kindle_highlight.rb in kindle-highlights-0.0.7
- old
+ new
@@ -2,12 +2,13 @@
attr_accessor :highlights
def initialize(email_address, password)
@agent = Mechanize.new
- @agent.user_agent_alias = 'Mac Safari'
- page = @agent.get("https://www.amazon.com/ap/signin?openid.assoc_handle=amzn_kindle&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.pape.max_auth_age=0&openid.mode=checkid_setup&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.return_to=https%3A%2F%2Fkindle.amazon.com%3A443%2Fauthenticate%2Flogin_callback%3Fwctx%3D%252F&pageId=amzn_kindle")
+ @agent.user_agent_alias = 'Windows Mozilla'
+ @agent.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
+ page = @agent.get("https://www.amazon.com/ap/signin?openid.assoc_handle=amzn_kindle&openid.mode=checkid_setup&pageId=amzn_kindle&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.return_to=https%3A%2F%2Fkindle.amazon.com%3A443%2Fauthenticate%2Flogin_callback%3Fwctx%3D%252F&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.pape.max_auth_age=0&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0")
@amazon_form = page.form('signIn')
@amazon_form.email = email_address
@amazon_form.password = password
scrape_highlights
end
@@ -19,7 +20,6 @@
highlights_page.search(".//div[@class='highlightRow yourHighlight']").each do |h|
collected_highlights << Highlight.new(h)
end
self.highlights = collected_highlights
end
-end
-
+end
\ No newline at end of file