tdiary-contrib 4.0.4 → 4.0.5.1
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.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/Gemfile +2 -8
- data/Gemfile.lock +17 -21
- data/README.en.md +1 -1
- data/filter/commentsize.rb +1 -1
- data/filter/iplookup.rb +55 -55
- data/filter/plugin/commentsize.rb +1 -1
- data/filter/plugin/en/spambayes.rb +1 -1
- data/filter/plugin/iplookup.rb +39 -39
- data/filter/plugin/ja/antirefspam.rb +1 -1
- data/filter/plugin/ja/spambayes.rb +1 -1
- data/filter/plugin/spambayes.rb +1 -1
- data/filter/spambayes.rb +1 -1
- data/js/flickr.js +1 -1
- data/lib/bayes.rb +1 -1
- data/lib/bayes/convert.rb +1 -1
- data/lib/tdiary/contrib/version.rb +1 -1
- data/lib/wgs2tky.rb +93 -93
- data/plugin/appstore.rb +6 -6
- data/plugin/bigpresen.rb +3 -3
- data/plugin/bitly.rb +1 -1
- data/plugin/brow_si.rb +1 -1
- data/plugin/category_similar.rb +1 -1
- data/plugin/category_to_tagcloud.rb +2 -2
- data/plugin/coderay.rb +1 -1
- data/plugin/datepicker.rb +1 -1
- data/plugin/flickr.rb +2 -2
- data/plugin/git-register.rb +7 -7
- data/plugin/goo_gl.rb +7 -7
- data/plugin/google_map.rb +6 -6
- data/plugin/google_webmaster.rb +4 -4
- data/plugin/hb_footer.rb +5 -5
- data/plugin/hb_footer4sec.rb +5 -5
- data/plugin/hide_sidebar_iphone.rb +1 -1
- data/plugin/iddy.rb +1 -1
- data/plugin/image_ex.rb +17 -17
- data/plugin/image_gps.rb +3 -3
- data/plugin/inline_wiki.rb +6 -6
- data/plugin/instagr.rb +8 -8
- data/plugin/instagram.rb +1 -1
- data/plugin/ja/yo_update.rb +51 -0
- data/plugin/jquery_ui_theme.rb +8 -8
- data/plugin/jroku.rb +1 -1
- data/plugin/jyear.rb +2 -2
- data/plugin/makerss_category.rb +4 -4
- data/plugin/makerss_comment.rb +4 -4
- data/plugin/microsummary.rb +2 -2
- data/plugin/nhk_program_info.rb +2 -2
- data/plugin/picasa.rb +2 -2
- data/plugin/playstore.rb +3 -3
- data/plugin/rating.rb +10 -10
- data/plugin/recent_estraier.rb +7 -7
- data/plugin/search-bing.rb +1 -1
- data/plugin/search-google-custom.rb +1 -1
- data/plugin/search-yahoo-websearch.rb +8 -8
- data/plugin/search-yahoo.rb +1 -1
- data/plugin/section_footer2.rb +1 -1
- data/plugin/show_and_hide.rb +20 -20
- data/plugin/socialbutton.rb +2 -2
- data/plugin/tdiarytimes.rb +16 -16
- data/plugin/tdiarytimes2.rb +10 -10
- data/plugin/tdiarytimes_textstyle.rb +3 -3
- data/plugin/twitter_anywhere.rb +51 -51
- data/plugin/twitter_summary_card.rb +1 -1
- data/plugin/vote.rb +4 -4
- data/plugin/yahoo_kousei.rb +2 -2
- data/plugin/yo_update.rb +214 -0
- data/plugin/zenback.rb +2 -2
- data/spec/apple_webclip_spec.rb +6 -6
- data/util/estraier-search/estraier-register.rb +2 -2
- data/util/image-gallery/image-gallery.rb +8 -8
- data/util/image-gallery/misc/plugin/recent_image.rb +4 -4
- data/util/posttdiary/posttdiary-ex.rb +7 -7
- data/util/rast-search/rast-register.rb +1 -1
- metadata +4 -2
@@ -41,7 +41,7 @@ add_conf_proc('Twitter Summary Card', 'Twitter Summary Card') do
|
|
41
41
|
<<-HTML
|
42
42
|
<h2>Twitter Summary Card</h2>
|
43
43
|
<p>
|
44
|
-
Please refer to the following documentation at first.
|
44
|
+
Please refer to the following documentation at first.
|
45
45
|
<ul>
|
46
46
|
<li><a href="https://dev.twitter.com/docs/cards/types/summary-card" target="_blank">Summary Card | Twitter Developers</a></li>
|
47
47
|
</ul>
|
data/plugin/vote.rb
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
# You can redistribute it and/or modify it under GPL2.
|
4
4
|
#
|
5
5
|
# ref. http://elpeo.jp/diary/20060622.html#p01
|
6
|
-
#
|
7
|
-
# .tdiary-vote {
|
6
|
+
#
|
7
|
+
# .tdiary-vote {
|
8
8
|
# float: left;
|
9
9
|
# background-color: aqua;
|
10
10
|
# }
|
@@ -53,7 +53,7 @@ def get_vote( date, uid )
|
|
53
53
|
voted = db['voter'].include?( uid ) if db.root?( 'voter' )
|
54
54
|
db.abort
|
55
55
|
end
|
56
|
-
end
|
56
|
+
end
|
57
57
|
[h, voted]
|
58
58
|
end
|
59
59
|
|
@@ -81,7 +81,7 @@ end
|
|
81
81
|
|
82
82
|
unless bot? then
|
83
83
|
if @mode == 'comment' && @cgi.valid?( 'vote' ) && @cgi.cookies['tdiary_vote'][0] then
|
84
|
-
add_vote( @date, @cgi.params['vote'][0], @cgi.cookies['tdiary_vote'][0] )
|
84
|
+
add_vote( @date, @cgi.params['vote'][0], @cgi.cookies['tdiary_vote'][0] )
|
85
85
|
end
|
86
86
|
|
87
87
|
add_footer_proc do
|
data/plugin/yahoo_kousei.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#
|
2
|
-
# yahoo_kousei.rb -
|
2
|
+
# yahoo_kousei.rb -
|
3
3
|
# Yahoo!JAPANデベロッパーネットワークの校正支援APIを利用して、
|
4
4
|
# 日本語文の校正作業を支援します。文字の入力ミスや言葉の誤用がないか、
|
5
5
|
# わかりにくい表記や不適切な表現が使われていないかなどをチェックします。
|
@@ -32,7 +32,7 @@ def kousei_api( sentence )
|
|
32
32
|
|
33
33
|
px_host, px_port = (@conf['proxy'] || '').split( /:/ )
|
34
34
|
px_port = 80 if px_host and !px_port
|
35
|
-
|
35
|
+
|
36
36
|
xml = ''
|
37
37
|
Net::HTTP::Proxy( px_host, px_port ).start( 'jlp.yahooapis.jp' ) do |http|
|
38
38
|
xml = http.post( '/KouseiService/V1/kousei', query ).body
|
data/plugin/yo_update.rb
ADDED
@@ -0,0 +1,214 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# yo_update.rb - Yo all when an entry or a comment is posted
|
4
|
+
#
|
5
|
+
# Copyright (C) 2014, zunda <zundan at gmail.com>
|
6
|
+
#
|
7
|
+
# Permission is granted for use, copying, modification,
|
8
|
+
# distribution, and distribution of modified versions of this
|
9
|
+
# work under the terms of GPL version 2 or later.
|
10
|
+
#
|
11
|
+
|
12
|
+
require 'uri'
|
13
|
+
require 'timeout'
|
14
|
+
require 'net/http'
|
15
|
+
require 'json'
|
16
|
+
|
17
|
+
YO_UPDATE_TIMEOUT = 10
|
18
|
+
|
19
|
+
class YoUpdateError < StandardError; end
|
20
|
+
|
21
|
+
def yo_update_api_key
|
22
|
+
r = @conf['yo_update.api_key']
|
23
|
+
if not r or r.empty?
|
24
|
+
return nil
|
25
|
+
end
|
26
|
+
return r
|
27
|
+
end
|
28
|
+
|
29
|
+
def yo_update_access_api(req)
|
30
|
+
if @conf['proxy']
|
31
|
+
proxy_uri = URI("http://" + @conf['proxy'])
|
32
|
+
proxy_addr = proxy_uri.host
|
33
|
+
proxy_port = proxy_uri.port
|
34
|
+
else
|
35
|
+
proxy_addr = nil
|
36
|
+
proxy_port = nil
|
37
|
+
end
|
38
|
+
begin
|
39
|
+
timeout(YO_UPDATE_TIMEOUT) do
|
40
|
+
return Net::HTTP.start(req.uri.host, req.uri.port, proxy_addr, proxt_port){|http|
|
41
|
+
http.request(req)
|
42
|
+
}
|
43
|
+
end
|
44
|
+
rescue Timeout::Error
|
45
|
+
raise YoUpdateError, "Timeout accessing Yo API"
|
46
|
+
rescue SocketError => e
|
47
|
+
raise YoUpdateError, e.message
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def yo_update_send_yo(username = nil)
|
52
|
+
api_key = yo_update_api_key
|
53
|
+
unless api_key
|
54
|
+
raise YoUpdateError, "Yo API Key is not set"
|
55
|
+
end
|
56
|
+
unless username
|
57
|
+
req = Net::HTTP::Post.new(URI("http://api.justyo.co/yoall/"))
|
58
|
+
req.set_form_data('api_token' => yo_update_api_key)
|
59
|
+
expected = '{}'
|
60
|
+
else
|
61
|
+
req = Net::HTTP::Post.new(URI("http://api.justyo.co/yo/"))
|
62
|
+
req.set_form_data('api_token' => yo_update_api_key, 'username' => username)
|
63
|
+
expected = '{"result": "OK"}'
|
64
|
+
end
|
65
|
+
res = yo_update_access_api(req)
|
66
|
+
data = res.body
|
67
|
+
unless data == expected
|
68
|
+
raise YoUpdateError, "error from Yo API: #{data}"
|
69
|
+
end
|
70
|
+
return data
|
71
|
+
end
|
72
|
+
|
73
|
+
def yo_update_send_yo_or_log(username = nil)
|
74
|
+
return unless yo_update_api_key
|
75
|
+
begin
|
76
|
+
yo_update_send_yo(username)
|
77
|
+
rescue YoUpdateError => e
|
78
|
+
@logger.error "yo_update.rb: #{e.message}"
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
def yo_update_subscribers_count
|
83
|
+
api_key = yo_update_api_key
|
84
|
+
unless api_key
|
85
|
+
raise YoUpdateError, "Yo API Key is not set"
|
86
|
+
end
|
87
|
+
req = Net::HTTP::Get.new(
|
88
|
+
URI("http://api.justyo.co/subscribers_count/?api_token=#{URI.escape(api_key)}")
|
89
|
+
)
|
90
|
+
res = yo_update_access_api(req)
|
91
|
+
data = res.body
|
92
|
+
begin
|
93
|
+
r = JSON::parse(data)
|
94
|
+
if r.has_key?('result')
|
95
|
+
return r['result']
|
96
|
+
else
|
97
|
+
raise YoUpdateError, "Error from Yo API: #{data}"
|
98
|
+
end
|
99
|
+
rescue JSON::ParserError
|
100
|
+
raise YoUpdateError, "Error from Yo API: #{data}"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
unless defined? yo_update_conf_label # maybe defined in a language resource
|
105
|
+
def yo_update_conf_label
|
106
|
+
'Send Yo with updates'
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
unless defined? yo_update_test_result_label # maybe defined in a language resource
|
111
|
+
def yo_update_test_result_label(username, result)
|
112
|
+
"- Sent to <tt>#{h username}</tt> and got <tt>#{h result}</tt>"
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
unless defined? yo_update_conf_html # maybe defined in a language resource
|
117
|
+
def yo_update_conf_html(conf, n_subscribers, test_result)
|
118
|
+
action_label = {
|
119
|
+
'send_on_update' => 'when an entry is added',
|
120
|
+
'send_on_comment' => 'when a comment is posted',
|
121
|
+
}
|
122
|
+
<<-HTML
|
123
|
+
<h3 class="subtitle">API key</h3>
|
124
|
+
<p><input name="yo_update.api_key" value="#{h conf['yo_update.api_key']}" size="40"></p>
|
125
|
+
<h3 class="subtitle">Username</h3>
|
126
|
+
<p><input name="yo_update.username" value="#{h conf['yo_update.username']}" size="40"></p>
|
127
|
+
<h3 class="subtitle">Send Yo</h3>
|
128
|
+
<ul>
|
129
|
+
#{%w(send_on_update send_on_comment).map{|action|
|
130
|
+
checked = conf["yo_update.#{action}"] ? ' checked' : ''
|
131
|
+
%Q|<li><label for="yo_update.#{action}"><input id="yo_update.#{action}" name="yo_update.#{action}" value="t" type="checkbox"#{checked}>#{action_label[action]}</label>|
|
132
|
+
}.join("\n\t")}
|
133
|
+
</ul>
|
134
|
+
<p>Test sending Yo! to <input name="yo_update.test" value="" size="10">#{test_result}</p>
|
135
|
+
<h3 class="subtitle">Current Subscribers</h3>
|
136
|
+
<p>#{h n_subscribers}</p>
|
137
|
+
<h3 class="subtitle">Yo button</h3>
|
138
|
+
<p>Add the following to somewhere or your diary.</p>
|
139
|
+
<pre><div id="yo-button"></div></pre>
|
140
|
+
<h3 class="subtitle">Howto</h3>
|
141
|
+
<ol>
|
142
|
+
<li>Sign in with your personal Yo account at <a href="http://dev.justyo.co/">http://dev.justyo.co/</a>
|
143
|
+
<li>Follow the instructions to obtain new API account.
|
144
|
+
Please leave the Callback URL blank.
|
145
|
+
<li>Copy the API key and API username above.
|
146
|
+
</ol>
|
147
|
+
HTML
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
add_conf_proc('yo_update', yo_update_conf_label) do
|
152
|
+
test_result = ''
|
153
|
+
if @mode == 'saveconf' then
|
154
|
+
@conf['yo_update.api_key'] = @cgi.params['yo_update.api_key'][0]
|
155
|
+
@conf['yo_update.username'] = @cgi.params['yo_update.username'][0]
|
156
|
+
@conf['yo_update.send_on_update'] = (@cgi.params['yo_update.send_on_update'][0] == 't')
|
157
|
+
@conf['yo_update.send_on_comment'] = (@cgi.params['yo_update.send_on_comment'][0] == 't')
|
158
|
+
test_username = @cgi.params['yo_update.test'][0]
|
159
|
+
if test_username and not test_username.empty?
|
160
|
+
begin
|
161
|
+
result = yo_update_send_yo(test_username)
|
162
|
+
rescue YoUpdateError => e
|
163
|
+
result = e.message
|
164
|
+
end
|
165
|
+
test_result = yo_update_test_result_label(test_username, result)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
unless @conf.has_key?('yo_update.send_on_update')
|
169
|
+
@conf['yo_update.send_on_update'] = true
|
170
|
+
end
|
171
|
+
begin
|
172
|
+
n_subscribers = yo_update_subscribers_count
|
173
|
+
rescue YoUpdateError => e
|
174
|
+
n_subscribers = e.message
|
175
|
+
end
|
176
|
+
yo_update_conf_html(@conf, n_subscribers, test_result)
|
177
|
+
end
|
178
|
+
|
179
|
+
add_update_proc do
|
180
|
+
if @mode == 'append' and @conf['yo_update.send_on_update']
|
181
|
+
yo_update_send_yo_or_log
|
182
|
+
elsif @mode == 'comment' and @comment and @comment.visible? and @conf['yo_update.send_on_comment']
|
183
|
+
yo_update_send_yo_or_log
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
add_header_proc do
|
188
|
+
if @conf['yo_update.api_key']
|
189
|
+
triggers = []
|
190
|
+
triggers << 'Entry' if @conf['yo_update.send_on_update']
|
191
|
+
triggers << 'Tsukkomi' if @conf['yo_update.send_on_comment']
|
192
|
+
trigger_str = "#{triggers.join(' or ')} is added"
|
193
|
+
<<-HTML
|
194
|
+
<script type="text/javascript"><!--
|
195
|
+
var _yoData = {
|
196
|
+
"username": "#{@conf['yo_update.username']}",
|
197
|
+
"trigger": "#{trigger_str}"
|
198
|
+
};
|
199
|
+
var s = document.createElement("script");
|
200
|
+
s.type = "text/javascript";
|
201
|
+
s.src = "//yoapp.s3.amazonaws.com/js/yo-button.js";
|
202
|
+
(document.head || document.getElementsByTagName("head")[0]).appendChild(s);
|
203
|
+
--></script>
|
204
|
+
HTML
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
# Local Variables:
|
209
|
+
# mode: ruby
|
210
|
+
# indent-tabs-mode: t
|
211
|
+
# tab-width: 3
|
212
|
+
# ruby-indent-level: 3
|
213
|
+
# End:
|
214
|
+
# vim: ts=3 sw=3
|
data/plugin/zenback.rb
CHANGED
@@ -15,12 +15,12 @@ if @mode == 'day' and (respond_to?(:section_mode?) ? section_mode? : true)
|
|
15
15
|
end
|
16
16
|
if defined? add_comment_leave_proc
|
17
17
|
add_comment_leave_proc do
|
18
|
-
"<!-- zenback_body_end -->" +
|
18
|
+
"<!-- zenback_body_end -->" +
|
19
19
|
insert_zenback
|
20
20
|
end
|
21
21
|
else
|
22
22
|
add_body_leave_proc do
|
23
|
-
"<!-- zenback_body_end -->" +
|
23
|
+
"<!-- zenback_body_end -->" +
|
24
24
|
insert_zenback
|
25
25
|
end
|
26
26
|
end
|
data/spec/apple_webclip_spec.rb
CHANGED
@@ -13,8 +13,8 @@ describe "apple_webclip plugin" do
|
|
13
13
|
plugin = setup_apple_webclip_plugin('http://example.com/example.png')
|
14
14
|
@header_snippet = plugin.header_proc
|
15
15
|
end
|
16
|
-
|
17
|
-
it "header include url" do
|
16
|
+
|
17
|
+
it "header include url" do
|
18
18
|
expect(@header_snippet).to eq(%Q|\t<link rel="apple-touch-icon" href="http://example.com/example.png">|)
|
19
19
|
end
|
20
20
|
end
|
@@ -25,8 +25,8 @@ describe "apple_webclip plugin" do
|
|
25
25
|
plugin = setup_apple_webclip_plugin('')
|
26
26
|
@header_snippet = plugin.header_proc
|
27
27
|
end
|
28
|
-
|
29
|
-
it "header is empty" do
|
28
|
+
|
29
|
+
it "header is empty" do
|
30
30
|
expect(@header_snippet).to be_empty
|
31
31
|
end
|
32
32
|
end
|
@@ -36,8 +36,8 @@ describe "apple_webclip plugin" do
|
|
36
36
|
plugin = setup_apple_webclip_plugin(nil)
|
37
37
|
@header_snippet = plugin.header_proc
|
38
38
|
end
|
39
|
-
|
40
|
-
it "header is empty" do
|
39
|
+
|
40
|
+
it "header is empty" do
|
41
41
|
expect(@header_snippet).to be_empty
|
42
42
|
end
|
43
43
|
end
|
@@ -186,7 +186,7 @@ module ::TDiary
|
|
186
186
|
@db.put_doc(doc)
|
187
187
|
end
|
188
188
|
end
|
189
|
-
|
189
|
+
|
190
190
|
protected
|
191
191
|
|
192
192
|
def mode; 'day'; end
|
@@ -265,7 +265,7 @@ else
|
|
265
265
|
conf.hide_comment_form = true
|
266
266
|
conf.show_nyear = false
|
267
267
|
def conf.bot?; true; end
|
268
|
-
|
268
|
+
|
269
269
|
diary = @diaries[@date.strftime('%Y%m%d')]
|
270
270
|
TDiary::EstraierDB.new(conf).transaction do |estraier_db|
|
271
271
|
TDiary::EstraierRegister.new(estraier_db, diary).execute(true)
|
@@ -5,10 +5,10 @@
|
|
5
5
|
# Copyright (c) 2005-2013 N.KASHIJUKU <n-kashi[at]whi.m-net.ne.jp>
|
6
6
|
# You can redistribute it and/or modify it under GPL2.
|
7
7
|
|
8
|
-
if RUBY_VERSION >= '1.9.0'
|
9
|
-
Encoding::default_external = 'UTF-8'
|
10
|
-
$LOAD_PATH.push('./')
|
11
|
-
end
|
8
|
+
if RUBY_VERSION >= '1.9.0'
|
9
|
+
Encoding::default_external = 'UTF-8'
|
10
|
+
$LOAD_PATH.push('./')
|
11
|
+
end
|
12
12
|
|
13
13
|
if FileTest::symlink?( __FILE__ ) then
|
14
14
|
org_path = File::dirname( File::readlink( __FILE__ ) )
|
@@ -29,7 +29,7 @@ module TDiary
|
|
29
29
|
attr_writer :file, :url, :title, :subtitle, :date, :width, :height, :type
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
|
33
33
|
class TDiaryGallery < ::TDiary::TDiaryBase
|
34
34
|
MAX_PAGES = 20
|
35
35
|
ORDER_OPTIONS = [
|
@@ -71,7 +71,7 @@ module TDiary
|
|
71
71
|
@width = conf.options['image-gallery.width']
|
72
72
|
@width = "160" if @width == nil
|
73
73
|
@vwidth = conf.options['image-gallery.vwidth']
|
74
|
-
@vwidth = "640" if @vwidth == nil
|
74
|
+
@vwidth = "640" if @vwidth == nil
|
75
75
|
@show_exif = conf.options['image-gallery.show_exif']
|
76
76
|
@show_exif = false if @show_exif == nil
|
77
77
|
@use_mid_image = conf.options['image-gallery.use_mid_image']
|
@@ -212,7 +212,7 @@ module TDiary
|
|
212
212
|
rescue
|
213
213
|
end
|
214
214
|
end
|
215
|
-
|
215
|
+
|
216
216
|
def format_links(count)
|
217
217
|
page_count = (count - 1) / @num + 1
|
218
218
|
current_page = @start / @num + 1
|
@@ -306,7 +306,7 @@ module TDiary
|
|
306
306
|
elsif @page_month != ""
|
307
307
|
prevmonth = (@page_date << 1).strftime("%Y%m")
|
308
308
|
nextmonth = (@page_date >> 1).strftime("%Y%m")
|
309
|
-
if @name_filter[0] == ?^ and @name_filter[5] == ?/
|
309
|
+
if @name_filter[0] == ?^ and @name_filter[5] == ?/
|
310
310
|
prevmonth = %Q[^#{prevmonth[0,4]}/#{prevmonth}]
|
311
311
|
nextmonth = %Q[^#{nextmonth[0,4]}/#{nextmonth}]
|
312
312
|
elsif @name_filter[0] == ?^
|
@@ -94,7 +94,7 @@ def image_info_rcimg( filename )
|
|
94
94
|
data = $'
|
95
95
|
|
96
96
|
until data.empty?
|
97
|
-
if RUBY_VERSION >= '1.9.0'
|
97
|
+
if RUBY_VERSION >= '1.9.0'
|
98
98
|
break if data[0].unpack("C").first != 0xFF
|
99
99
|
break if data[1].unpack("C").first == 0xD9
|
100
100
|
else
|
@@ -230,7 +230,7 @@ def init_rcimg
|
|
230
230
|
make_image_hash_rcimg
|
231
231
|
keysort_rcimg
|
232
232
|
if @recent_image_use_cache
|
233
|
-
save_cache_rcimg
|
233
|
+
save_cache_rcimg
|
234
234
|
end
|
235
235
|
end
|
236
236
|
end
|
@@ -294,7 +294,7 @@ def count_image(name_filter = nil, title_filter = nil)
|
|
294
294
|
init_rcimg
|
295
295
|
|
296
296
|
if name_filter == nil and title_filter == nil
|
297
|
-
count = @recent_image_keys.length
|
297
|
+
count = @recent_image_keys.length
|
298
298
|
else
|
299
299
|
@recent_image_keys.each do |key|
|
300
300
|
image = @recent_image_hash[key]
|
@@ -350,7 +350,7 @@ end
|
|
350
350
|
# Callback Functions
|
351
351
|
|
352
352
|
# this is for view_exif().
|
353
|
-
add_body_enter_proc(Proc.new do |date|
|
353
|
+
add_body_enter_proc(Proc.new do |date|
|
354
354
|
@image_date_exif = date.strftime("%Y%m%d")
|
355
355
|
""
|
356
356
|
end)
|
@@ -8,7 +8,7 @@
|
|
8
8
|
# 2010.10.19: v.1.71: Modified by K.Sakurai (http://ks.nwr.jp)
|
9
9
|
# Acknowledgements:
|
10
10
|
# * Based on posttdiary.rb & tdiary.rb by TADA.
|
11
|
-
# * Some codes partially imported from Enikki Plugin Ex. :
|
11
|
+
# * Some codes partially imported from Enikki Plugin Ex. :
|
12
12
|
# http://shimoi.s26.xrea.com/hiki/hiki.cgi?TdiaryEnikkiEx
|
13
13
|
# * Thanks to taketori for image size detection method.
|
14
14
|
# * Thanks to NOB for debugging.
|
@@ -124,7 +124,7 @@ def usage( detailed_help )
|
|
124
124
|
! ex2. -z 140 (same to 140x140)
|
125
125
|
! --image-format, -f format string:
|
126
126
|
! Specify the format string of the image tag
|
127
|
-
! These variables can be used in the format string:
|
127
|
+
! These variables can be used in the format string:
|
128
128
|
! $0 : image serial number
|
129
129
|
! $1 : image url
|
130
130
|
! $2 : thumbnail image url (when -t is specified)
|
@@ -420,7 +420,7 @@ end
|
|
420
420
|
|
421
421
|
def add_body_text( prev, sub_head , sub_body )
|
422
422
|
addtext = prev
|
423
|
-
if prev.size > 0 and !(prev =~ /\n$/) then
|
423
|
+
if prev.size > 0 and !(prev =~ /\n$/) then
|
424
424
|
addtext += "\n"
|
425
425
|
end
|
426
426
|
if sub_head =~ %r[^Content-Transfer-Encoding:\s*base64]i then
|
@@ -630,7 +630,7 @@ def parse_mail( head, body , image_dir )
|
|
630
630
|
orglist[imgnum] = orgname
|
631
631
|
end
|
632
632
|
end
|
633
|
-
elsif head =~ /^Content-Type:\s*text\/plain/i
|
633
|
+
elsif head =~ /^Content-Type:\s*text\/plain/i
|
634
634
|
textbody = add_body_text( textbody , head, body )
|
635
635
|
else
|
636
636
|
raise "posttdiary-ex: can not read this mail (illegal format)"
|
@@ -912,7 +912,7 @@ begin
|
|
912
912
|
user = ARGV.shift.dup
|
913
913
|
pass = ARGV.shift.dup
|
914
914
|
end
|
915
|
-
|
915
|
+
|
916
916
|
require 'base64'
|
917
917
|
require 'nkf'
|
918
918
|
require 'net/http'
|
@@ -921,7 +921,7 @@ begin
|
|
921
921
|
|
922
922
|
mail = NKF::nkf( '-m0 -Xwd', ARGF.read )
|
923
923
|
raise "posttdiary-ex: no mail text." if not mail or mail.length == 0
|
924
|
-
|
924
|
+
|
925
925
|
head, body = mail.split( /(?:\r\n){2}|\r\r|\n\n/, 2 )
|
926
926
|
body = "" unless body
|
927
927
|
addr, subject, tmpimglist, orglist, @body = parse_mail( head, body, image_dir )
|
@@ -971,7 +971,7 @@ begin
|
|
971
971
|
else
|
972
972
|
now = tmp
|
973
973
|
end
|
974
|
-
|
974
|
+
|
975
975
|
topic_year = now.strftime( "%Y" )
|
976
976
|
topic_month = now.strftime( "%m" )
|
977
977
|
topic_date = now.strftime( "%d" )
|