gmailer 0.1.9 → 0.2.0
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/CHANGES +3 -0
- data/gmailer.gempsec +1 -1
- data/gmailer.rb +11 -9
- metadata +2 -2
data/CHANGES
CHANGED
data/gmailer.gempsec
CHANGED
data/gmailer.rb
CHANGED
@@ -52,7 +52,7 @@ GM_ACT_DELSPAM = 20 # delete spam, forever
|
|
52
52
|
GM_ACT_DELTRASH = 21 # delete trash message, forever
|
53
53
|
|
54
54
|
module GMailer
|
55
|
-
VERSION = "0.
|
55
|
+
VERSION = "0.2.0"
|
56
56
|
attr_accessor :connection
|
57
57
|
|
58
58
|
# the main class.
|
@@ -187,33 +187,35 @@ module GMailer
|
|
187
187
|
result = ''
|
188
188
|
cookies += ';'+ __cookies(response['set-cookie'])
|
189
189
|
response = nil
|
190
|
-
|
190
|
+
np.set_debug_output($stdout) if DEBUG
|
191
191
|
np.start { |http|
|
192
192
|
response = http.get(url, {'Cookie' => cookies,'User-agent'=> GM_USER_AGENT} )
|
193
193
|
result = response.body
|
194
194
|
}
|
195
195
|
end
|
196
196
|
|
197
|
-
if response["Location"]!=nil
|
197
|
+
if response["Location"]!=nil
|
198
198
|
arr = URI::split(response["Location"])
|
199
199
|
np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(arr[2], 443)
|
200
200
|
np.use_ssl = true
|
201
201
|
np.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
202
202
|
result = ''
|
203
|
+
cookies = __cookies(response['set-cookie'])
|
203
204
|
response = nil
|
204
205
|
np.set_debug_output($stdout) if DEBUG
|
205
206
|
np.start { |http|
|
206
207
|
response = http.get("http://"+arr[2]+arr[5]+'?'+arr[7], {'Cookie' => cookies,'User-agent' => GM_USER_AGENT} )
|
207
208
|
result = response.body
|
208
|
-
}
|
209
|
+
}
|
209
210
|
end
|
210
|
-
|
211
|
-
if
|
211
|
+
|
212
|
+
if response["Location"]!=nil && result.include?("Moved Temporarily")
|
212
213
|
arr = URI::split(response["Location"])
|
213
214
|
np = Net::HTTP::Proxy(@proxy_host,@proxy_port,@proxy_user,@proxy_pass).new(arr[2], 443)
|
214
215
|
np.use_ssl = true
|
215
216
|
np.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
216
217
|
result = ''
|
218
|
+
cookies = __cookies(response['set-cookie'])
|
217
219
|
response = nil
|
218
220
|
np.set_debug_output($stdout) if DEBUG
|
219
221
|
np.start { |http|
|
@@ -295,7 +297,7 @@ module GMailer
|
|
295
297
|
packets = {}
|
296
298
|
matches.each do |x|
|
297
299
|
x = unescapeHTML(x)
|
298
|
-
tmp = eval(x.gsub(",,",",'',").gsub(",,",",'',").gsub(",]",",'']").gsub('#{','#\{'))
|
300
|
+
tmp = eval(x.gsub(",,",",'',").gsub(",,",",'',").gsub(",]",",'']").gsub('#{','#\{').gsub('#','\#'))
|
299
301
|
if (packets[tmp[0]] || (tmp[0]=="mi"||tmp[0]=="mb"||tmp[0]=="di"))
|
300
302
|
if (tmp[0]=="t"||tmp[0]=="ts"||tmp[0]=="a"||tmp[0]=="cl")
|
301
303
|
packets[tmp[0]] += tmp[1..-1]
|
@@ -349,8 +351,8 @@ module GMailer
|
|
349
351
|
matches = inbox.scan(/D\((.*)\)/).flatten
|
350
352
|
packets = {}
|
351
353
|
matches.each do |x|
|
352
|
-
|
353
|
-
tmp = eval(x.gsub(",,",",'',").gsub(",,",",'',").gsub(",]",",'']").gsub('#{','#\{'))
|
354
|
+
x = unescapeHTML(x)
|
355
|
+
tmp = eval(x.gsub(",,",",'',").gsub(",,",",'',").gsub(",]",",'']").gsub('#{','#\{').gsub('#','\#'))
|
354
356
|
if (packets[tmp[0]] || (tmp[0]=="mi"||tmp[0]=="mb"||tmp[0]=="di"))
|
355
357
|
if (tmp[0]=="t"||tmp[0]=="ts"||tmp[0]=="a"||tmp[0]=="cl")
|
356
358
|
packets[tmp[0]] += tmp[1..-1]
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: gmailer
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date: 2007-11-
|
6
|
+
version: 0.2.0
|
7
|
+
date: 2007-11-20 00:00:00 +09:00
|
8
8
|
summary: An class interface of the Google's webmail service
|
9
9
|
require_paths:
|
10
10
|
- ""
|