contacts 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/contacts/base.rb +2 -1
- metadata +5 -48
- data/doc/classes/Contacts.html +0 -195
- data/doc/classes/Contacts.src/M000001.html +0 -22
- data/doc/classes/Contacts.src/M000002.html +0 -24
- data/doc/classes/Contacts/AuthenticationError.html +0 -113
- data/doc/classes/Contacts/Base.html +0 -214
- data/doc/classes/Contacts/Base.src/M000006.html +0 -21
- data/doc/classes/Contacts/Base.src/M000007.html +0 -19
- data/doc/classes/Contacts/Base.src/M000008.html +0 -18
- data/doc/classes/Contacts/Base.src/M000009.html +0 -31
- data/doc/classes/Contacts/Base.src/M000010.html +0 -29
- data/doc/classes/Contacts/Base.src/M000011.html +0 -18
- data/doc/classes/Contacts/ConnectionError.html +0 -113
- data/doc/classes/Contacts/ContactsError.html +0 -111
- data/doc/classes/Contacts/Gmail.html +0 -172
- data/doc/classes/Contacts/Gmail.src/M000005.html +0 -60
- data/doc/classes/Contacts/Hotmail.html +0 -182
- data/doc/classes/Contacts/Hotmail.src/M000012.html +0 -74
- data/doc/classes/Contacts/TypeNotFound.html +0 -113
- data/doc/classes/Contacts/Yahoo.html +0 -187
- data/doc/classes/Contacts/Yahoo.src/M000003.html +0 -41
- data/doc/classes/Contacts/Yahoo.src/M000004.html +0 -45
- data/doc/created.rid +0 -1
- data/doc/files/README.html +0 -168
- data/doc/files/lib/contacts/base_rb.html +0 -114
- data/doc/files/lib/contacts/gmail_rb.html +0 -108
- data/doc/files/lib/contacts/hotmail_rb.html +0 -101
- data/doc/files/lib/contacts/yahoo_rb.html +0 -108
- data/doc/files/lib/contacts_rb.html +0 -112
- data/doc/fr_class_index.html +0 -35
- data/doc/fr_file_index.html +0 -32
- data/doc/fr_method_index.html +0 -38
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
- data/lib/contacts/foo.diff +0 -156
@@ -1,74 +0,0 @@
|
|
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>real_connect (Contacts::Hotmail)</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/hotmail.rb, line 11</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">real_connect</span>
|
15
|
-
<span class="ruby-ivar">@use_new_contact_url</span> = <span class="ruby-keyword kw">false</span>
|
16
|
-
|
17
|
-
<span class="ruby-identifier">data</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-identifier">forward</span> = <span class="ruby-identifier">get</span>(<span class="ruby-constant">URL</span>)
|
18
|
-
|
19
|
-
<span class="ruby-identifier">old_url</span> = <span class="ruby-constant">URL</span>
|
20
|
-
<span class="ruby-keyword kw">until</span> <span class="ruby-identifier">forward</span>.<span class="ruby-identifier">nil?</span>
|
21
|
-
<span class="ruby-identifier">data</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-identifier">forward</span>, <span class="ruby-identifier">old_url</span> = <span class="ruby-identifier">get</span>(<span class="ruby-identifier">forward</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-identifier">old_url</span>) <span class="ruby-operator">+</span> [<span class="ruby-identifier">forward</span>]
|
22
|
-
<span class="ruby-keyword kw">end</span>
|
23
|
-
|
24
|
-
<span class="ruby-identifier">postdata</span> = <span class="ruby-node">"PPSX=#{CGI.escape(data.split("><").grep(/PPSX/).first[/=\S+$/][2..-3])}&"</span>
|
25
|
-
<span class="ruby-identifier">postdata</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"PwdPad=#{PWDPAD[0...(PWDPAD.length-@password.length)]}&"</span>
|
26
|
-
<span class="ruby-identifier">postdata</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"login=#{CGI.escape(login)}&passwd=#{CGI.escape(password)}&LoginOptions=2&"</span>
|
27
|
-
<span class="ruby-identifier">postdata</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"PPFT=#{CGI.escape(data.split("><").grep(/PPFT/).first[/=\S+$/][2..-3])}"</span>
|
28
|
-
|
29
|
-
<span class="ruby-identifier">form_url</span> = <span class="ruby-identifier">data</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"><"</span>).<span class="ruby-identifier">grep</span>(<span class="ruby-regexp re">/form/</span>).<span class="ruby-identifier">first</span>.<span class="ruby-identifier">split</span>[<span class="ruby-value">5</span>][<span class="ruby-value">8</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>]
|
30
|
-
<span class="ruby-identifier">data</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-identifier">forward</span> = <span class="ruby-identifier">post</span>(<span class="ruby-identifier">form_url</span>, <span class="ruby-identifier">postdata</span>, <span class="ruby-identifier">cookies</span>)
|
31
|
-
|
32
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">"The e-mail address or password is incorrect"</span>)
|
33
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">AuthenticationError</span>, <span class="ruby-value str">"Username and password do not match"</span>
|
34
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">data</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">""</span>
|
35
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">AuthenticationError</span>, <span class="ruby-value str">"Required field must not be blank"</span>
|
36
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">cookies</span> <span class="ruby-operator">==</span> <span class="ruby-value str">""</span>
|
37
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConnectionError</span>, <span class="ruby-constant">PROTOCOL_ERROR</span>
|
38
|
-
<span class="ruby-keyword kw">end</span>
|
39
|
-
|
40
|
-
<span class="ruby-identifier">old_url</span> = <span class="ruby-identifier">form_url</span>
|
41
|
-
<span class="ruby-keyword kw">until</span> <span class="ruby-identifier">forward</span>.<span class="ruby-identifier">nil?</span>
|
42
|
-
<span class="ruby-identifier">data</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-identifier">forward</span>, <span class="ruby-identifier">old_url</span> = <span class="ruby-identifier">get</span>(<span class="ruby-identifier">forward</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-identifier">old_url</span>) <span class="ruby-operator">+</span> [<span class="ruby-identifier">forward</span>]
|
43
|
-
<span class="ruby-keyword kw">end</span>
|
44
|
-
|
45
|
-
<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>
|
46
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConnectionError</span>, <span class="ruby-constant">PROTOCOL_ERROR</span>
|
47
|
-
<span class="ruby-keyword kw">end</span>
|
48
|
-
|
49
|
-
<span class="ruby-identifier">forward</span> = <span class="ruby-value str">"http://www.hotmail.msn.com/cgi-bin/sbox"</span>
|
50
|
-
|
51
|
-
<span class="ruby-keyword kw">until</span> <span class="ruby-identifier">forward</span>.<span class="ruby-identifier">nil?</span>
|
52
|
-
<span class="ruby-identifier">data</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-identifier">forward</span>, <span class="ruby-identifier">old_url</span> = <span class="ruby-identifier">get</span>(<span class="ruby-identifier">forward</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-identifier">old_url</span>) <span class="ruby-operator">+</span> [<span class="ruby-identifier">forward</span>]
|
53
|
-
<span class="ruby-keyword kw">end</span>
|
54
|
-
|
55
|
-
<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>
|
56
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConnectionError</span>, <span class="ruby-constant">PROTOCOL_ERROR</span>
|
57
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">old_url</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value str">'login.live.com'</span>)
|
58
|
-
<span class="ruby-identifier">data</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-identifier">forward</span>, <span class="ruby-identifier">old_url</span> = <span class="ruby-identifier">get</span>(<span class="ruby-value str">"http://mail.live.com/mail"</span>, <span class="ruby-identifier">cookies</span>)
|
59
|
-
<span class="ruby-identifier">data</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-identifier">forward</span>, <span class="ruby-identifier">old_url</span> = <span class="ruby-identifier">get</span>(<span class="ruby-identifier">forward</span>, <span class="ruby-identifier">cookies</span>)
|
60
|
-
<span class="ruby-identifier">old_url</span> = <span class="ruby-identifier">forward</span>
|
61
|
-
<span class="ruby-ivar">@use_new_contact_url</span> = <span class="ruby-keyword kw">true</span>
|
62
|
-
<span class="ruby-keyword kw">end</span>
|
63
|
-
|
64
|
-
<span class="ruby-ivar">@domain</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">old_url</span>).<span class="ruby-identifier">host</span>
|
65
|
-
<span class="ruby-ivar">@cookies</span> = <span class="ruby-identifier">cookies</span>
|
66
|
-
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">AuthenticationError</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">m</span>
|
67
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@attempt</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span>
|
68
|
-
<span class="ruby-keyword kw">retry</span>
|
69
|
-
<span class="ruby-keyword kw">else</span>
|
70
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">m</span>
|
71
|
-
<span class="ruby-keyword kw">end</span>
|
72
|
-
<span class="ruby-keyword kw">end</span></pre>
|
73
|
-
</body>
|
74
|
-
</html>
|
@@ -1,113 +0,0 @@
|
|
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: Contacts::TypeNotFound</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Contacts::TypeNotFound</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/contacts/base_rb.html">
|
59
|
-
lib/contacts/base.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
<a href="ContactsError.html">
|
69
|
-
ContactsError
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
</div>
|
86
|
-
|
87
|
-
|
88
|
-
</div>
|
89
|
-
|
90
|
-
|
91
|
-
<!-- if includes -->
|
92
|
-
|
93
|
-
<div id="section">
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
<!-- if method_list -->
|
103
|
-
|
104
|
-
|
105
|
-
</div>
|
106
|
-
|
107
|
-
|
108
|
-
<div id="validator-badges">
|
109
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
110
|
-
</div>
|
111
|
-
|
112
|
-
</body>
|
113
|
-
</html>
|
@@ -1,187 +0,0 @@
|
|
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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>Class: Contacts::Yahoo</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="classHeader">
|
50
|
-
<table class="header-table">
|
51
|
-
<tr class="top-aligned-row">
|
52
|
-
<td><strong>Class</strong></td>
|
53
|
-
<td class="class-name-in-header">Contacts::Yahoo</td>
|
54
|
-
</tr>
|
55
|
-
<tr class="top-aligned-row">
|
56
|
-
<td><strong>In:</strong></td>
|
57
|
-
<td>
|
58
|
-
<a href="../../files/lib/contacts/yahoo_rb.html">
|
59
|
-
lib/contacts/yahoo.rb
|
60
|
-
</a>
|
61
|
-
<br />
|
62
|
-
</td>
|
63
|
-
</tr>
|
64
|
-
|
65
|
-
<tr class="top-aligned-row">
|
66
|
-
<td><strong>Parent:</strong></td>
|
67
|
-
<td>
|
68
|
-
<a href="Base.html">
|
69
|
-
Base
|
70
|
-
</a>
|
71
|
-
</td>
|
72
|
-
</tr>
|
73
|
-
</table>
|
74
|
-
</div>
|
75
|
-
<!-- banner header -->
|
76
|
-
|
77
|
-
<div id="bodyContent">
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<div id="contextContent">
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
</div>
|
86
|
-
|
87
|
-
<div id="method-list">
|
88
|
-
<h3 class="section-bar">Methods</h3>
|
89
|
-
|
90
|
-
<div class="name-list">
|
91
|
-
<a href="#M000004">contacts</a>
|
92
|
-
<a href="#M000003">real_connect</a>
|
93
|
-
</div>
|
94
|
-
</div>
|
95
|
-
|
96
|
-
</div>
|
97
|
-
|
98
|
-
|
99
|
-
<!-- if includes -->
|
100
|
-
|
101
|
-
<div id="section">
|
102
|
-
|
103
|
-
|
104
|
-
<div id="constants-list">
|
105
|
-
<h3 class="section-bar">Constants</h3>
|
106
|
-
|
107
|
-
<div class="name-list">
|
108
|
-
<table summary="Constants">
|
109
|
-
<tr class="top-aligned-row context-row">
|
110
|
-
<td class="context-item-name">URL</td>
|
111
|
-
<td>=</td>
|
112
|
-
<td class="context-item-value">"http://mail.yahoo.com/"</td>
|
113
|
-
</tr>
|
114
|
-
<tr class="top-aligned-row context-row">
|
115
|
-
<td class="context-item-name">LOGIN_URL</td>
|
116
|
-
<td>=</td>
|
117
|
-
<td class="context-item-value">"https://login.yahoo.com/config/login"</td>
|
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>
|
124
|
-
<tr class="top-aligned-row context-row">
|
125
|
-
<td class="context-item-name">CONTACT_LIST_URL</td>
|
126
|
-
<td>=</td>
|
127
|
-
<td class="context-item-value">"http://address.yahoo.com/index.php?VPC=import_export&A=B&submit[action_export_yahoo]=Export%20Now"</td>
|
128
|
-
</tr>
|
129
|
-
<tr class="top-aligned-row context-row">
|
130
|
-
<td class="context-item-name">PROTOCOL_ERROR</td>
|
131
|
-
<td>=</td>
|
132
|
-
<td class="context-item-value">"Yahoo has changed its protocols, please upgrade this library first. If that does not work, contact lucas@rufy.com with this error"</td>
|
133
|
-
</tr>
|
134
|
-
</table>
|
135
|
-
</div>
|
136
|
-
</div>
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
<!-- if method_list -->
|
144
|
-
<div id="methods">
|
145
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
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
|
-
|
161
|
-
<div id="method-M000003" class="method-detail">
|
162
|
-
<a name="M000003"></a>
|
163
|
-
|
164
|
-
<div class="method-heading">
|
165
|
-
<a href="Yahoo.src/M000003.html" target="Code" class="method-signature"
|
166
|
-
onclick="popupCode('Yahoo.src/M000003.html');return false;">
|
167
|
-
<span class="method-name">real_connect</span><span class="method-args">()</span>
|
168
|
-
</a>
|
169
|
-
</div>
|
170
|
-
|
171
|
-
<div class="method-description">
|
172
|
-
</div>
|
173
|
-
</div>
|
174
|
-
|
175
|
-
|
176
|
-
</div>
|
177
|
-
|
178
|
-
|
179
|
-
</div>
|
180
|
-
|
181
|
-
|
182
|
-
<div id="validator-badges">
|
183
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
184
|
-
</div>
|
185
|
-
|
186
|
-
</body>
|
187
|
-
</html>
|
@@ -1,41 +0,0 @@
|
|
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>real_connect (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 11</span>
|
14
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">real_connect</span>
|
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
|
-
<span class="ruby-identifier">postdata</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">"&.partner=&.u=4eo6isd23l8r3&.v=0&.challenge=gsMsEcoZP7km3N3NeI4mX"</span>
|
17
|
-
<span class="ruby-identifier">postdata</span> <span class="ruby-operator">+=</span> <span class="ruby-value str">"kGB7zMV&.yplus=&.emailCode=&pkg=&stepid=&.ev=&hasMsgr=1&.chkP=Y&."</span>
|
18
|
-
<span class="ruby-identifier">postdata</span> <span class="ruby-operator">+=</span> <span class="ruby-node">"done=#{CGI.escape(URL)}&login=#{CGI.escape(login)}&passwd=#{CGI.escape(password)}"</span>
|
19
|
-
|
20
|
-
<span class="ruby-identifier">data</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-identifier">forward</span> = <span class="ruby-identifier">post</span>(<span class="ruby-constant">LOGIN_URL</span>, <span class="ruby-identifier">postdata</span>)
|
21
|
-
|
22
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">"Invalid ID or password"</span>)
|
23
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">AuthenticationError</span>, <span class="ruby-value str">"Username and password do not match"</span>
|
24
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">"Sign in"</span>) <span class="ruby-operator">&&</span> <span class="ruby-identifier">data</span>.<span class="ruby-identifier">index</span>(<span class="ruby-value str">"to Yahoo!"</span>)
|
25
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">AuthenticationError</span>, <span class="ruby-value str">"Required field must not be blank"</span>
|
26
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">data</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">""</span>
|
27
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConnectionError</span>, <span class="ruby-constant">PROTOCOL_ERROR</span>
|
28
|
-
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">cookies</span> <span class="ruby-operator">==</span> <span class="ruby-value str">""</span>
|
29
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConnectionError</span>, <span class="ruby-constant">PROTOCOL_ERROR</span>
|
30
|
-
<span class="ruby-keyword kw">end</span>
|
31
|
-
|
32
|
-
<span class="ruby-identifier">data</span>, <span class="ruby-identifier">resp</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-identifier">forward</span> = <span class="ruby-identifier">get</span>(<span class="ruby-identifier">forward</span>, <span class="ruby-identifier">cookies</span>, <span class="ruby-constant">LOGIN_URL</span>)
|
33
|
-
|
34
|
-
<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>
|
35
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ConnectionError</span>, <span class="ruby-constant">PROTOCOL_ERROR</span>
|
36
|
-
<span class="ruby-keyword kw">end</span>
|
37
|
-
|
38
|
-
<span class="ruby-ivar">@cookies</span> = <span class="ruby-identifier">cookies</span>
|
39
|
-
<span class="ruby-keyword kw">end</span></pre>
|
40
|
-
</body>
|
41
|
-
</html>
|
@@ -1,45 +0,0 @@
|
|
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>
|