AddressBookImporter 0.0.10 → 0.0.11
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/lib/address_book_importer.rb +2 -4
- metadata +2 -2
|
@@ -4,7 +4,7 @@ require 'cgi'
|
|
|
4
4
|
require 'iconv'
|
|
5
5
|
|
|
6
6
|
module AddressBookImporter
|
|
7
|
-
VERSION = '0.0.
|
|
7
|
+
VERSION = '0.0.11'
|
|
8
8
|
|
|
9
9
|
class EmptyEmailException < Exception ; end
|
|
10
10
|
class LoginErrorException < Exception ; end
|
|
@@ -44,12 +44,10 @@ module AddressBookImporter
|
|
|
44
44
|
form.fields.find {|f| f.name == 'passwd'}.value = password
|
|
45
45
|
page = @agent.submit(form, form.buttons.first)
|
|
46
46
|
raise LoginErrorException if page.body.match(/icon_err\.gif/)
|
|
47
|
-
|
|
48
47
|
url = page.root.at('script').inner_html.match(%r{(http:[^"]+)})[0]
|
|
49
48
|
p = @agent.get(url) # http://by132w.bay132.mail.live.com/mail/mail.aspx
|
|
50
49
|
if (match = p.body.match(/(http:\/\/[^"'\/\\]*\.mail\.live\.com)/))
|
|
51
50
|
@mode = :live
|
|
52
|
-
p = @agent.get(match[1])
|
|
53
51
|
else
|
|
54
52
|
@mode = :normal
|
|
55
53
|
end
|
|
@@ -109,7 +107,7 @@ module AddressBookImporter
|
|
|
109
107
|
form.fields.find {|f| f.name == 'Email'}.value = login
|
|
110
108
|
form.fields.find {|f| f.name == 'Passwd'}.value = password
|
|
111
109
|
page = @agent.submit(form, form.buttons.first)
|
|
112
|
-
raise LoginErrorException if page.uri.to_s
|
|
110
|
+
raise LoginErrorException if page.uri.to_s =~ /https:\/\/www\.google\.com\/accounts\/ServiceLoginAuth/
|
|
113
111
|
url = "http://mail.google.com/mail/?ui=html&zy=n"
|
|
114
112
|
page = @agent.get(url)
|
|
115
113
|
@base = page.uri.to_s.split('?').first
|
metadata
CHANGED
|
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
|
3
3
|
specification_version: 1
|
|
4
4
|
name: AddressBookImporter
|
|
5
5
|
version: !ruby/object:Gem::Version
|
|
6
|
-
version: 0.0.
|
|
7
|
-
date: 2007-08-
|
|
6
|
+
version: 0.0.11
|
|
7
|
+
date: 2007-08-10 00:00:00 +02:00
|
|
8
8
|
summary: Mechanize scraper for address books
|
|
9
9
|
require_paths:
|
|
10
10
|
- lib
|