contacts 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/classes/Contacts.html +1 -1
- data/doc/classes/Contacts.src/M000001.html +1 -1
- data/doc/classes/Contacts.src/M000002.html +1 -1
- data/doc/classes/Contacts/Base.html +26 -26
- data/doc/classes/Contacts/Base.src/M000006.html +7 -5
- data/doc/classes/Contacts/Base.src/M000007.html +5 -4
- data/doc/classes/Contacts/Base.src/M000008.html +4 -17
- data/doc/classes/Contacts/Base.src/M000009.html +15 -13
- data/doc/classes/Contacts/Base.src/M000010.html +15 -4
- data/doc/classes/Contacts/Base.src/{M000005.html → M000011.html} +4 -7
- data/doc/classes/Contacts/Gmail.html +5 -5
- data/doc/classes/Contacts/Gmail.src/{M000004.html → M000005.html} +0 -0
- data/doc/classes/Contacts/Hotmail.html +5 -5
- data/doc/classes/Contacts/Hotmail.src/{M000011.html → M000012.html} +0 -0
- data/doc/classes/Contacts/Yahoo.html +20 -0
- data/doc/classes/Contacts/Yahoo.src/M000003.html +1 -1
- data/doc/classes/Contacts/Yahoo.src/M000004.html +45 -0
- data/doc/created.rid +1 -1
- data/doc/files/lib/contacts/base_rb.html +1 -1
- data/doc/files/lib/contacts/yahoo_rb.html +1 -1
- data/doc/fr_method_index.html +9 -8
- data/lib/contacts/base.rb +5 -1
- data/lib/contacts/yahoo.rb +32 -0
- metadata +6 -5
data/doc/classes/Contacts.html
CHANGED
@@ -137,7 +137,7 @@ Class <a href="Contacts/Yahoo.html" class="link">Contacts::Yahoo</a><br />
|
|
137
137
|
<tr class="top-aligned-row context-row">
|
138
138
|
<td class="context-item-name">VERSION</td>
|
139
139
|
<td>=</td>
|
140
|
-
<td class="context-item-value">"1.0.
|
140
|
+
<td class="context-item-value">"1.0.4"</td>
|
141
141
|
</tr>
|
142
142
|
</table>
|
143
143
|
</div>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line 186</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">login</span>, <span class="ruby-identifier">password</span>)
|
15
15
|
<span class="ruby-keyword kw">if</span> <span class="ruby-constant">TYPES</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">intern</span>)
|
16
16
|
<span class="ruby-constant">TYPES</span>[<span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">intern</span>].<span class="ruby-identifier">new</span>(<span class="ruby-identifier">login</span>, <span class="ruby-identifier">password</span>)
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line 194</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">guess</span>(<span class="ruby-identifier">login</span>, <span class="ruby-identifier">password</span>)
|
15
15
|
<span class="ruby-constant">TYPES</span>.<span class="ruby-identifier">inject</span>([]) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">a</span>, <span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
|
16
16
|
<span class="ruby-keyword kw">begin</span>
|
@@ -86,12 +86,12 @@
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
87
87
|
|
88
88
|
<div class="name-list">
|
89
|
-
<a href="#
|
90
|
-
<a href="#
|
91
|
-
<a href="#
|
92
|
-
<a href="#
|
93
|
-
<a href="#
|
94
|
-
<a href="#
|
89
|
+
<a href="#M000007">connect</a>
|
90
|
+
<a href="#M000008">connected?</a>
|
91
|
+
<a href="#M000009">contacts</a>
|
92
|
+
<a href="#M000010">login</a>
|
93
|
+
<a href="#M000006">new</a>
|
94
|
+
<a href="#M000011">password</a>
|
95
95
|
</div>
|
96
96
|
</div>
|
97
97
|
|
@@ -113,29 +113,13 @@
|
|
113
113
|
<div id="methods">
|
114
114
|
<h3 class="section-bar">Public Class methods</h3>
|
115
115
|
|
116
|
-
<div id="method-M000005" class="method-detail">
|
117
|
-
<a name="M000005"></a>
|
118
|
-
|
119
|
-
<div class="method-heading">
|
120
|
-
<a href="Base.src/M000005.html" target="Code" class="method-signature"
|
121
|
-
onclick="popupCode('Base.src/M000005.html');return false;">
|
122
|
-
<span class="method-name">new</span><span class="method-args">(login, password)</span>
|
123
|
-
</a>
|
124
|
-
</div>
|
125
|
-
|
126
|
-
<div class="method-description">
|
127
|
-
</div>
|
128
|
-
</div>
|
129
|
-
|
130
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
131
|
-
|
132
116
|
<div id="method-M000006" class="method-detail">
|
133
117
|
<a name="M000006"></a>
|
134
118
|
|
135
119
|
<div class="method-heading">
|
136
120
|
<a href="Base.src/M000006.html" target="Code" class="method-signature"
|
137
121
|
onclick="popupCode('Base.src/M000006.html');return false;">
|
138
|
-
<span class="method-name">
|
122
|
+
<span class="method-name">new</span><span class="method-args">(login, password)</span>
|
139
123
|
</a>
|
140
124
|
</div>
|
141
125
|
|
@@ -143,13 +127,15 @@
|
|
143
127
|
</div>
|
144
128
|
</div>
|
145
129
|
|
130
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
131
|
+
|
146
132
|
<div id="method-M000007" class="method-detail">
|
147
133
|
<a name="M000007"></a>
|
148
134
|
|
149
135
|
<div class="method-heading">
|
150
136
|
<a href="Base.src/M000007.html" target="Code" class="method-signature"
|
151
137
|
onclick="popupCode('Base.src/M000007.html');return false;">
|
152
|
-
<span class="method-name">
|
138
|
+
<span class="method-name">connect</span><span class="method-args">()</span>
|
153
139
|
</a>
|
154
140
|
</div>
|
155
141
|
|
@@ -163,7 +149,7 @@
|
|
163
149
|
<div class="method-heading">
|
164
150
|
<a href="Base.src/M000008.html" target="Code" class="method-signature"
|
165
151
|
onclick="popupCode('Base.src/M000008.html');return false;">
|
166
|
-
<span class="method-name">
|
152
|
+
<span class="method-name">connected?</span><span class="method-args">()</span>
|
167
153
|
</a>
|
168
154
|
</div>
|
169
155
|
|
@@ -177,7 +163,7 @@
|
|
177
163
|
<div class="method-heading">
|
178
164
|
<a href="Base.src/M000009.html" target="Code" class="method-signature"
|
179
165
|
onclick="popupCode('Base.src/M000009.html');return false;">
|
180
|
-
<span class="method-name">
|
166
|
+
<span class="method-name">contacts</span><span class="method-args">()</span>
|
181
167
|
</a>
|
182
168
|
</div>
|
183
169
|
|
@@ -191,6 +177,20 @@
|
|
191
177
|
<div class="method-heading">
|
192
178
|
<a href="Base.src/M000010.html" target="Code" class="method-signature"
|
193
179
|
onclick="popupCode('Base.src/M000010.html');return false;">
|
180
|
+
<span class="method-name">login</span><span class="method-args">()</span>
|
181
|
+
</a>
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div class="method-description">
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
<div id="method-M000011" class="method-detail">
|
189
|
+
<a name="M000011"></a>
|
190
|
+
|
191
|
+
<div class="method-heading">
|
192
|
+
<a href="Base.src/M000011.html" target="Code" class="method-signature"
|
193
|
+
onclick="popupCode('Base.src/M000011.html');return false;">
|
194
194
|
<span class="method-name">password</span><span class="method-args">()</span>
|
195
195
|
</a>
|
196
196
|
</div>
|
@@ -5,15 +5,17 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>new (Contacts::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
16
|
-
<span class="ruby-identifier">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line 14</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">login</span>, <span class="ruby-identifier">password</span>)
|
15
|
+
<span class="ruby-ivar">@login</span> = <span class="ruby-identifier">login</span>
|
16
|
+
<span class="ruby-ivar">@password</span> = <span class="ruby-identifier">password</span>
|
17
|
+
<span class="ruby-ivar">@connections</span> = {}
|
18
|
+
<span class="ruby-identifier">connect</span>
|
17
19
|
<span class="ruby-keyword kw">end</span></pre>
|
18
20
|
</body>
|
19
21
|
</html>
|
@@ -5,14 +5,15 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>connect (Contacts::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line 21</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">connect</span>
|
15
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">AuthenticationError</span>, <span class="ruby-node">"Login and password must not be nil, login: #{@login.inspect}, password: #{@password.inspect}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@login</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@password</span>.<span class="ruby-identifier">nil?</span>
|
16
|
+
<span class="ruby-identifier">real_connect</span>
|
16
17
|
<span class="ruby-keyword kw">end</span></pre>
|
17
18
|
</body>
|
18
19
|
</html>
|
@@ -5,27 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>connected? (Contacts::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-
|
16
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">connected?</span>
|
17
|
-
<span class="ruby-identifier">url</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">contact_list_url</span>)
|
18
|
-
<span class="ruby-identifier">http</span> = <span class="ruby-identifier">open_http</span>(<span class="ruby-identifier">url</span>)
|
19
|
-
<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">data</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">get</span>(<span class="ruby-node">"#{url.path}?#{url.query}"</span>,
|
20
|
-
<span class="ruby-value str">"Cookie"</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@cookies</span>
|
21
|
-
)
|
22
|
-
|
23
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">code_type</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPOK</span>
|
24
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConnectionError</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">:PROTOCOL_ERROR</span>)
|
25
|
-
<span class="ruby-keyword kw">end</span>
|
26
|
-
|
27
|
-
<span class="ruby-identifier">parse</span> <span class="ruby-identifier">data</span>
|
28
|
-
<span class="ruby-keyword kw">end</span>
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line 26</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">connected?</span>
|
15
|
+
<span class="ruby-ivar">@cookies</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@cookies</span>.<span class="ruby-identifier">empty?</span>
|
29
16
|
<span class="ruby-keyword kw">end</span></pre>
|
30
17
|
</body>
|
31
18
|
</html>
|
@@ -5,24 +5,26 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>contacts (Contacts::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-ivar">@
|
16
|
-
<span class="ruby-
|
17
|
-
|
18
|
-
|
19
|
-
<span class="ruby-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<span class="ruby-keyword kw">
|
24
|
-
<span class="ruby-
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line 30</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">contacts</span>
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@contacts</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@contacts</span>
|
16
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">connected?</span>
|
17
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">contact_list_url</span>)
|
18
|
+
<span class="ruby-identifier">http</span> = <span class="ruby-identifier">open_http</span>(<span class="ruby-identifier">url</span>)
|
19
|
+
<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">data</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">get</span>(<span class="ruby-node">"#{url.path}?#{url.query}"</span>,
|
20
|
+
<span class="ruby-value str">"Cookie"</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@cookies</span>
|
21
|
+
)
|
22
|
+
|
23
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">code_type</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPOK</span>
|
24
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConnectionError</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">:PROTOCOL_ERROR</span>)
|
25
25
|
<span class="ruby-keyword kw">end</span>
|
26
|
+
|
27
|
+
<span class="ruby-identifier">parse</span> <span class="ruby-identifier">data</span>
|
26
28
|
<span class="ruby-keyword kw">end</span>
|
27
29
|
<span class="ruby-keyword kw">end</span></pre>
|
28
30
|
</body>
|
@@ -5,14 +5,25 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>login (Contacts::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-ivar">@
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line 47</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">login</span>
|
15
|
+
<span class="ruby-ivar">@attempt</span> <span class="ruby-operator">||=</span> <span class="ruby-value">0</span>
|
16
|
+
<span class="ruby-ivar">@attempt</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
17
|
+
|
18
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@attempt</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
19
|
+
<span class="ruby-ivar">@login</span>
|
20
|
+
<span class="ruby-keyword kw">else</span>
|
21
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@login</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-node">"@#{domain}"</span>)
|
22
|
+
<span class="ruby-ivar">@login</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-node">"@#{domain}"</span>,<span class="ruby-value str">""</span>)
|
23
|
+
<span class="ruby-keyword kw">else</span>
|
24
|
+
<span class="ruby-node">"#{@login}@#{domain}"</span>
|
25
|
+
<span class="ruby-keyword kw">end</span>
|
26
|
+
<span class="ruby-keyword kw">end</span>
|
16
27
|
<span class="ruby-keyword kw">end</span></pre>
|
17
28
|
</body>
|
18
29
|
</html>
|
@@ -5,17 +5,14 @@
|
|
5
5
|
|
6
6
|
<html>
|
7
7
|
<head>
|
8
|
-
<title>
|
8
|
+
<title>password (Contacts::Base)</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
15
|
-
<span class="ruby-ivar">@
|
16
|
-
<span class="ruby-ivar">@password</span> = <span class="ruby-identifier">password</span>
|
17
|
-
<span class="ruby-ivar">@connections</span> = {}
|
18
|
-
<span class="ruby-identifier">connect</span>
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/contacts/base.rb, line 62</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">password</span>
|
15
|
+
<span class="ruby-ivar">@password</span>
|
19
16
|
<span class="ruby-keyword kw">end</span></pre>
|
20
17
|
</body>
|
21
18
|
</html>
|
@@ -88,7 +88,7 @@
|
|
88
88
|
<h3 class="section-bar">Methods</h3>
|
89
89
|
|
90
90
|
<div class="name-list">
|
91
|
-
<a href="#
|
91
|
+
<a href="#M000005">real_connect</a>
|
92
92
|
</div>
|
93
93
|
</div>
|
94
94
|
|
@@ -143,12 +143,12 @@
|
|
143
143
|
<div id="methods">
|
144
144
|
<h3 class="section-bar">Public Instance methods</h3>
|
145
145
|
|
146
|
-
<div id="method-
|
147
|
-
<a name="
|
146
|
+
<div id="method-M000005" class="method-detail">
|
147
|
+
<a name="M000005"></a>
|
148
148
|
|
149
149
|
<div class="method-heading">
|
150
|
-
<a href="Gmail.src/
|
151
|
-
onclick="popupCode('Gmail.src/
|
150
|
+
<a href="Gmail.src/M000005.html" target="Code" class="method-signature"
|
151
|
+
onclick="popupCode('Gmail.src/M000005.html');return false;">
|
152
152
|
<span class="method-name">real_connect</span><span class="method-args">()</span>
|
153
153
|
</a>
|
154
154
|
</div>
|
File without changes
|
@@ -88,7 +88,7 @@
|
|
88
88
|
<h3 class="section-bar">Methods</h3>
|
89
89
|
|
90
90
|
<div class="name-list">
|
91
|
-
<a href="#
|
91
|
+
<a href="#M000012">real_connect</a>
|
92
92
|
</div>
|
93
93
|
</div>
|
94
94
|
|
@@ -153,12 +153,12 @@
|
|
153
153
|
<div id="methods">
|
154
154
|
<h3 class="section-bar">Public Instance methods</h3>
|
155
155
|
|
156
|
-
<div id="method-
|
157
|
-
<a name="
|
156
|
+
<div id="method-M000012" class="method-detail">
|
157
|
+
<a name="M000012"></a>
|
158
158
|
|
159
159
|
<div class="method-heading">
|
160
|
-
<a href="Hotmail.src/
|
161
|
-
onclick="popupCode('Hotmail.src/
|
160
|
+
<a href="Hotmail.src/M000012.html" target="Code" class="method-signature"
|
161
|
+
onclick="popupCode('Hotmail.src/M000012.html');return false;">
|
162
162
|
<span class="method-name">real_connect</span><span class="method-args">()</span>
|
163
163
|
</a>
|
164
164
|
</div>
|
File without changes
|
@@ -88,6 +88,7 @@
|
|
88
88
|
<h3 class="section-bar">Methods</h3>
|
89
89
|
|
90
90
|
<div class="name-list">
|
91
|
+
<a href="#M000004">contacts</a>
|
91
92
|
<a href="#M000003">real_connect</a>
|
92
93
|
</div>
|
93
94
|
</div>
|
@@ -115,6 +116,11 @@
|
|
115
116
|
<td>=</td>
|
116
117
|
<td class="context-item-value">"https://login.yahoo.com/config/login"</td>
|
117
118
|
</tr>
|
119
|
+
<tr class="top-aligned-row context-row">
|
120
|
+
<td class="context-item-name">ADDRESS_BOOK_URL</td>
|
121
|
+
<td>=</td>
|
122
|
+
<td class="context-item-value">"http://address.mail.yahoo.com/?1&VPC=import_export"</td>
|
123
|
+
</tr>
|
118
124
|
<tr class="top-aligned-row context-row">
|
119
125
|
<td class="context-item-name">CONTACT_LIST_URL</td>
|
120
126
|
<td>=</td>
|
@@ -138,6 +144,20 @@
|
|
138
144
|
<div id="methods">
|
139
145
|
<h3 class="section-bar">Public Instance methods</h3>
|
140
146
|
|
147
|
+
<div id="method-M000004" class="method-detail">
|
148
|
+
<a name="M000004"></a>
|
149
|
+
|
150
|
+
<div class="method-heading">
|
151
|
+
<a href="Yahoo.src/M000004.html" target="Code" class="method-signature"
|
152
|
+
onclick="popupCode('Yahoo.src/M000004.html');return false;">
|
153
|
+
<span class="method-name">contacts</span><span class="method-args">()</span>
|
154
|
+
</a>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
<div class="method-description">
|
158
|
+
</div>
|
159
|
+
</div>
|
160
|
+
|
141
161
|
<div id="method-M000003" class="method-detail">
|
142
162
|
<a name="M000003"></a>
|
143
163
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/contacts/yahoo.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/contacts/yahoo.rb, line 11</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">real_connect</span>
|
15
15
|
<span class="ruby-identifier">postdata</span> = <span class="ruby-value str">".tries=2&.src=ym&.md5=&.hash=&.js=&.last=&promo=&.intl=us&.bypass="</span>
|
16
16
|
<span class="ruby-identifier">postdata</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">"&.partner=&.u=4eo6isd23l8r3&.v=0&.challenge=gsMsEcoZP7km3N3NeI4mX"</span>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>contacts (Contacts::Yahoo)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/contacts/yahoo.rb, line 38</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">contacts</span>
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@contacts</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@contacts</span>
|
16
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">connected?</span>
|
17
|
+
<span class="ruby-comment cmt"># first, get the addressbook site with the new crumb parameter</span>
|
18
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">address_book_url</span>)
|
19
|
+
<span class="ruby-identifier">http</span> = <span class="ruby-identifier">open_http</span>(<span class="ruby-identifier">url</span>)
|
20
|
+
<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">data</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">get</span>(<span class="ruby-node">"#{url.path}?#{url.query}"</span>,
|
21
|
+
<span class="ruby-value str">"Cookie"</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@cookies</span>
|
22
|
+
)
|
23
|
+
|
24
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">code_type</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPOK</span>
|
25
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConnectionError</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">:PROTOCOL_ERROR</span>)
|
26
|
+
<span class="ruby-keyword kw">end</span>
|
27
|
+
|
28
|
+
<span class="ruby-identifier">crumb</span> = <span class="ruby-identifier">data</span>.<span class="ruby-identifier">to_s</span>[<span class="ruby-regexp re">/id="crumb2" value="(.*?)"/</span>][<span class="ruby-value">19</span><span class="ruby-operator">...</span><span class="ruby-value">-1</span>]
|
29
|
+
|
30
|
+
<span class="ruby-comment cmt"># now proceed with the new ".crumb" parameter to get the csv data</span>
|
31
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-node">"#{contact_list_url}&.crumb=#{crumb}"</span>)
|
32
|
+
<span class="ruby-identifier">http</span> = <span class="ruby-identifier">open_http</span>(<span class="ruby-identifier">url</span>)
|
33
|
+
<span class="ruby-identifier">resp</span>, <span class="ruby-identifier">data</span> = <span class="ruby-identifier">http</span>.<span class="ruby-identifier">get</span>(<span class="ruby-node">"#{url.path}?#{url.query}"</span>,
|
34
|
+
<span class="ruby-value str">"Cookie"</span> =<span class="ruby-operator">></span> <span class="ruby-ivar">@cookies</span>
|
35
|
+
)
|
36
|
+
|
37
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">resp</span>.<span class="ruby-identifier">code_type</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Net</span><span class="ruby-operator">::</span><span class="ruby-constant">HTTPOK</span>
|
38
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConnectionError</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">:PROTOCOL_ERROR</span>)
|
39
|
+
<span class="ruby-keyword kw">end</span>
|
40
|
+
|
41
|
+
<span class="ruby-identifier">parse</span> <span class="ruby-identifier">data</span>
|
42
|
+
<span class="ruby-keyword kw">end</span>
|
43
|
+
<span class="ruby-keyword kw">end</span></pre>
|
44
|
+
</body>
|
45
|
+
</html>
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Tue Aug 28 17:00:59 PDT 2007
|
data/doc/fr_method_index.html
CHANGED
@@ -20,17 +20,18 @@
|
|
20
20
|
<div id="index">
|
21
21
|
<h1 class="section-bar">Methods</h1>
|
22
22
|
<div id="index-entries">
|
23
|
-
<a href="classes/Contacts/Base.html#
|
24
|
-
<a href="classes/Contacts/Base.html#
|
25
|
-
<a href="classes/Contacts/
|
23
|
+
<a href="classes/Contacts/Base.html#M000007">connect (Contacts::Base)</a><br />
|
24
|
+
<a href="classes/Contacts/Base.html#M000008">connected? (Contacts::Base)</a><br />
|
25
|
+
<a href="classes/Contacts/Yahoo.html#M000004">contacts (Contacts::Yahoo)</a><br />
|
26
|
+
<a href="classes/Contacts/Base.html#M000009">contacts (Contacts::Base)</a><br />
|
26
27
|
<a href="classes/Contacts.html#M000002">guess (Contacts)</a><br />
|
27
|
-
<a href="classes/Contacts/Base.html#
|
28
|
+
<a href="classes/Contacts/Base.html#M000010">login (Contacts::Base)</a><br />
|
28
29
|
<a href="classes/Contacts.html#M000001">new (Contacts)</a><br />
|
29
|
-
<a href="classes/Contacts/Base.html#
|
30
|
-
<a href="classes/Contacts/Base.html#
|
30
|
+
<a href="classes/Contacts/Base.html#M000006">new (Contacts::Base)</a><br />
|
31
|
+
<a href="classes/Contacts/Base.html#M000011">password (Contacts::Base)</a><br />
|
31
32
|
<a href="classes/Contacts/Yahoo.html#M000003">real_connect (Contacts::Yahoo)</a><br />
|
32
|
-
<a href="classes/Contacts/Gmail.html#
|
33
|
-
<a href="classes/Contacts/Hotmail.html#
|
33
|
+
<a href="classes/Contacts/Gmail.html#M000005">real_connect (Contacts::Gmail)</a><br />
|
34
|
+
<a href="classes/Contacts/Hotmail.html#M000012">real_connect (Contacts::Hotmail)</a><br />
|
34
35
|
</div>
|
35
36
|
</div>
|
36
37
|
</body>
|
data/lib/contacts/base.rb
CHANGED
@@ -8,7 +8,7 @@ require "thread"
|
|
8
8
|
|
9
9
|
class Contacts
|
10
10
|
TYPES = {}
|
11
|
-
VERSION = "1.0.
|
11
|
+
VERSION = "1.0.4"
|
12
12
|
|
13
13
|
class Base
|
14
14
|
def initialize(login, password)
|
@@ -73,6 +73,10 @@ class Contacts
|
|
73
73
|
self.class.const_get(:CONTACT_LIST_URL)
|
74
74
|
end
|
75
75
|
|
76
|
+
def address_book_url
|
77
|
+
self.class.const_get(:ADDRESS_BOOK_URL)
|
78
|
+
end
|
79
|
+
|
76
80
|
def open_http(url)
|
77
81
|
c = @connections[Thread.current.object_id] ||= {}
|
78
82
|
http = c["#{url.host}:#{url.port}"]
|
data/lib/contacts/yahoo.rb
CHANGED
@@ -4,6 +4,7 @@ class Contacts
|
|
4
4
|
class Yahoo < Base
|
5
5
|
URL = "http://mail.yahoo.com/"
|
6
6
|
LOGIN_URL = "https://login.yahoo.com/config/login"
|
7
|
+
ADDRESS_BOOK_URL = "http://address.mail.yahoo.com/?1&VPC=import_export"
|
7
8
|
CONTACT_LIST_URL = "http://address.yahoo.com/index.php?VPC=import_export&A=B&submit[action_export_yahoo]=Export%20Now"
|
8
9
|
PROTOCOL_ERROR = "Yahoo has changed its protocols, please upgrade this library first. If that does not work, contact lucas@rufy.com with this error"
|
9
10
|
|
@@ -34,6 +35,37 @@ class Contacts
|
|
34
35
|
@cookies = cookies
|
35
36
|
end
|
36
37
|
|
38
|
+
def contacts
|
39
|
+
return @contacts if @contacts
|
40
|
+
if connected?
|
41
|
+
# first, get the addressbook site with the new crumb parameter
|
42
|
+
url = URI.parse(address_book_url)
|
43
|
+
http = open_http(url)
|
44
|
+
resp, data = http.get("#{url.path}?#{url.query}",
|
45
|
+
"Cookie" => @cookies
|
46
|
+
)
|
47
|
+
|
48
|
+
if resp.code_type != Net::HTTPOK
|
49
|
+
raise ConnectionError, self.class.const_get(:PROTOCOL_ERROR)
|
50
|
+
end
|
51
|
+
|
52
|
+
crumb = data.to_s[/id="crumb2" value="(.*?)"/][19...-1]
|
53
|
+
|
54
|
+
# now proceed with the new ".crumb" parameter to get the csv data
|
55
|
+
url = URI.parse("#{contact_list_url}&.crumb=#{crumb}")
|
56
|
+
http = open_http(url)
|
57
|
+
resp, data = http.get("#{url.path}?#{url.query}",
|
58
|
+
"Cookie" => @cookies
|
59
|
+
)
|
60
|
+
|
61
|
+
if resp.code_type != Net::HTTPOK
|
62
|
+
raise ConnectionError, self.class.const_get(:PROTOCOL_ERROR)
|
63
|
+
end
|
64
|
+
|
65
|
+
parse data
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
37
69
|
private
|
38
70
|
|
39
71
|
def parse(data)
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: contacts
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date: 2007-
|
6
|
+
version: 1.0.4
|
7
|
+
date: 2007-08-28 00:00:00 -07:00
|
8
8
|
summary: Ridiculously easy contact list information from various providers including Yahoo, Gmail, and Hotmail
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -61,15 +61,16 @@ files:
|
|
61
61
|
- doc/classes/Contacts/TypeNotFound.html
|
62
62
|
- doc/classes/Contacts/Yahoo.html
|
63
63
|
- doc/classes/Contacts/Yahoo.src
|
64
|
-
- doc/classes/Contacts/Base.src/M000005.html
|
65
64
|
- doc/classes/Contacts/Base.src/M000006.html
|
66
65
|
- doc/classes/Contacts/Base.src/M000007.html
|
67
66
|
- doc/classes/Contacts/Base.src/M000008.html
|
68
67
|
- doc/classes/Contacts/Base.src/M000009.html
|
69
68
|
- doc/classes/Contacts/Base.src/M000010.html
|
70
|
-
- doc/classes/Contacts/
|
71
|
-
- doc/classes/Contacts/
|
69
|
+
- doc/classes/Contacts/Base.src/M000011.html
|
70
|
+
- doc/classes/Contacts/Gmail.src/M000005.html
|
71
|
+
- doc/classes/Contacts/Hotmail.src/M000012.html
|
72
72
|
- doc/classes/Contacts/Yahoo.src/M000003.html
|
73
|
+
- doc/classes/Contacts/Yahoo.src/M000004.html
|
73
74
|
- doc/classes/Contacts.src/M000001.html
|
74
75
|
- doc/classes/Contacts.src/M000002.html
|
75
76
|
- doc/files/lib
|