AddressBookImporter 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/History.txt +2 -0
- data/lib/address_book_importer.rb +4 -4
- data/test/test_address_book_importer.rb +1 -1
- metadata +4 -3
data/History.txt
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'mechanize'
|
3
3
|
|
4
4
|
module AddressBookImporter
|
5
|
-
VERSION = '0.0.
|
5
|
+
VERSION = '0.0.4'
|
6
6
|
|
7
7
|
class EmptyEmailException < Exception ; end
|
8
8
|
class LoginErrorException < Exception ; end
|
@@ -18,7 +18,7 @@ module AddressBookImporter
|
|
18
18
|
p = login(login, password)
|
19
19
|
@contacts = fetch_contacts(p)
|
20
20
|
rescue Exception => e
|
21
|
-
raise ParseException.new("Error parsing website + " + e.to_s)
|
21
|
+
raise ParseException.new("Error parsing website + " + e.to_s + e.backtrace.inspect)
|
22
22
|
end
|
23
23
|
raise EmptyEmailException if @contacts.empty?
|
24
24
|
end
|
@@ -46,8 +46,8 @@ module AddressBookImporter
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def fetch_contacts(page)
|
49
|
-
params = page.body.match(/(
|
50
|
-
start =
|
49
|
+
params = page.body.match(/(curmbox=[^&]+)/)[1]
|
50
|
+
start = page.body.match(/(a=[^"]+)/)[1]
|
51
51
|
contact_page = @agent.get("/cgi-bin/AddressPicker?" + start+params + "&Context=InsertAddress&_HMaction=Edit&qF=to")
|
52
52
|
rval = []
|
53
53
|
match_string = contact_page.body
|
@@ -8,7 +8,7 @@ class TestAddressBookImporter < Test::Unit::TestCase
|
|
8
8
|
HOTMAIL_TEST = {:username => '', :password => ''}
|
9
9
|
YAHOO_TEST = {:username => '', :password => ''}
|
10
10
|
|
11
|
-
|
11
|
+
def test_gmail
|
12
12
|
a = AddressBookImporter::Gmail.new(GMAIL_TEST[:username],GMAIL_TEST[:password])
|
13
13
|
assert !a.contacts.empty?
|
14
14
|
end
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
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:
|
6
|
+
version: 0.0.4
|
7
|
+
date: 2007-01-22 00:00:00 +01:00
|
8
8
|
summary: Mechanize scraper for address books
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -25,6 +25,7 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
25
25
|
platform: ruby
|
26
26
|
signing_key:
|
27
27
|
cert_chain:
|
28
|
+
post_install_message:
|
28
29
|
authors:
|
29
30
|
- adocca Entertainment AB
|
30
31
|
files:
|