tdiary-contrib 5.0.11 → 5.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tdiary/contrib/version.rb +1 -1
- data/plugin/add_bookmark.rb +1 -1
- data/plugin/google_map.rb +153 -141
- data/plugin/hb_footer.rb +2 -2
- data/plugin/image_ex.rb +4 -3
- data/plugin/instagram.rb +3 -2
- data/plugin/mm_footer.rb +2 -2
- data/plugin/my_hotentry.rb +1 -1
- data/plugin/notify_miniblog.rb +1 -1
- data/plugin/socialbutton.rb +2 -2
- data/plugin/tweet_quote.rb +4 -5
- data/plugin/yahoo_kousei.rb +1 -1
- data/plugin/yo_update.rb +1 -1
- data/spec/spec_helper.rb +6 -6
- data/style/hatena_style.rb +3 -3
- data/util/image-gallery/misc/plugin/recent_image.rb +2 -2
- data/util/image-gallery/misc/plugin/view_exif.rb +2 -2
- data/util/tdiary-grep/grep.rb +1 -1
- metadata +15 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 077a15f87d9312e2fd05c48aecdb4ea89bfeb7ef8e73b197eea443a0b628f75e
|
4
|
+
data.tar.gz: c488339e3f3dd2d99ea88d06e0f2fe35cebc7aa24dd3b66e5557e43535c3a392
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e438aaf3632d87cc666fd3d7f54b56e7962959501652f825cdf027b043e1c64540d5c0b382a92e88bdc8fb16d0f5146262664afc94a78650028b9173071bd6f
|
7
|
+
data.tar.gz: 3a31c1283e905e1880fe15f991ffc50c65eedf22a4471dad95b2b68a9af47f5fc2e75162617f5a2195fb0de9c9e328dfb6af276f3e83beda5484a4af2b318875
|
data/plugin/add_bookmark.rb
CHANGED
@@ -20,7 +20,7 @@ add_subtitle_proc do |date, index, subtitle|
|
|
20
20
|
section_url = @conf.base_url + anchor(date.strftime('%Y%m%d')) + '#p' + ('%02d' % index)
|
21
21
|
|
22
22
|
if @conf['add.bookmark.delicious'] == 't' then
|
23
|
-
escaped_url =
|
23
|
+
escaped_url = CGI.escape(section_url)
|
24
24
|
caption += %Q|<a href="http://delicious.com/save?url=#{escaped_url}" onclick="window.open('http://delicious.com/save?v=5;noui;jump=close;url=#{escaped_url};title='+encodeURIComponent(document.title), 'delicious', 'toolbar=no,width=550,height=550'); return false">|
|
25
25
|
caption += %Q|<img src="http://static.delicious.com/img/delicious.small.gif" width="10" height="10" style="border: 0 none;vertical-align: middle;" alt="#{@caption_delicious}">|
|
26
26
|
caption += %Q|</a> |
|
data/plugin/google_map.rb
CHANGED
@@ -1,174 +1,186 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
3
|
# google_map.rb - embeded Google Map for tDiary, use Google Maps JavaScript API V3.
|
4
|
-
#
|
4
|
+
# https://developers.google.com/maps/documentation/javascript/tutorial
|
5
5
|
#
|
6
6
|
# Copyright (C) 2010, tamoot <tamoot+tdiary@gmail.com>
|
7
7
|
# You can redistribute it and/or modify it under GPL2.
|
8
8
|
#
|
9
9
|
|
10
10
|
def google_map(lat, lon, params = {})
|
11
|
-
|
12
|
-
|
11
|
+
params.merge!(:lat => lat, :lon => lon)
|
12
|
+
google_map_common(params)
|
13
13
|
end
|
14
14
|
|
15
15
|
def google_geomap(address, params = {})
|
16
|
-
|
17
|
-
|
16
|
+
params.merge!(:address => address)
|
17
|
+
google_map_common(params)
|
18
18
|
end
|
19
19
|
|
20
20
|
def google_map_common(params)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
21
|
+
params[:id] ||= ''
|
22
|
+
params[:lat] ||= 0.0
|
23
|
+
params[:lon] ||= 0.0
|
24
|
+
params[:address] ||= nil
|
25
|
+
params[:zoom] ||= 10
|
26
|
+
params[:html] ||= nil
|
27
|
+
params[:title] ||= nil
|
28
|
+
params[:width] ||= 320
|
29
|
+
params[:height] ||= 240
|
30
|
+
params[:type] ||= :ROADMAP
|
31
|
+
params[:overview]||= false
|
32
|
+
|
33
|
+
if feed?
|
34
|
+
require 'cgi'
|
35
|
+
|
36
|
+
url = nil
|
37
|
+
if params[:lat].nonzero? && params[:lon].nonzero?
|
38
|
+
query = "#{params[:lat]},#{params[:lon]}"
|
39
|
+
url = %Q|https://maps.google.com/maps?q=#{CGI::escape(query)}|
|
40
|
+
|
41
|
+
elsif params[:address] != nil
|
42
|
+
query = params[:address]
|
43
|
+
url = %Q|https://maps.google.com/maps?q=#{CGI::escape(query)}|
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
return %Q|<a href="#{url}">#{url}</a>| if url
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
dom_id = "#{@gmap_date.strftime("%Y%m%d")}_#{@gmap_count}"
|
52
|
+
params.merge!(:id => dom_id)
|
53
|
+
@gmap_data << params
|
54
|
+
@gmap_count += 1
|
55
|
+
|
56
|
+
%Q|<div class="gmap" id="#{dom_id}" style="width : #{params[:width]}px; height : #{params[:height]}px;"></div>|
|
57
57
|
end
|
58
58
|
|
59
59
|
add_header_proc do
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
if /\A(?:latest|day|month|nyear|preview)\z/ =~ @mode
|
61
|
+
%Q|<script type="text/javascript" src="//maps.google.com/maps/api/js?key=#{@conf['google_map.key']}"></script>\n|
|
62
|
+
end
|
63
63
|
end
|
64
64
|
|
65
65
|
add_body_enter_proc do |date|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
66
|
+
@gmap_data = []
|
67
|
+
@gmap_date = date
|
68
|
+
@gmap_count = 0
|
69
|
+
''
|
70
70
|
end
|
71
71
|
|
72
72
|
add_body_leave_proc do |date|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
73
|
+
gmap_scripts = ''
|
74
|
+
if !feed? && @gmap_data.any?
|
75
|
+
gmap_scripts = %Q|<script type="text/javascript">\n<!--\n|
|
76
|
+
@gmap_data.each do |data|
|
77
|
+
if data[:address]
|
78
|
+
gmap_scripts << google_geomap_script(data)
|
79
|
+
else
|
80
|
+
gmap_scripts << google_map_script(data)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
gmap_scripts << %Q|//-->\n</script>\n|
|
84
|
+
end
|
85
|
+
gmap_scripts
|
86
|
+
end
|
87
|
+
|
88
|
+
add_conf_proc('google_map', 'Google Maps', 'etc') do
|
89
|
+
if @mode == 'saveconf' then
|
90
|
+
@conf['google_map.key'], = @cgi.params['google_map.key']
|
91
|
+
end
|
92
|
+
|
93
|
+
<<-HTML
|
94
|
+
<h3 class="subtitle">Google Maps API Key</h3>
|
95
|
+
<p>API Key (see <a href="https://developers.google.com/maps/documentation/javascript/get-api-key">developers.google.com/maps</a>)</p>
|
96
|
+
<p><input name="google_map.key" value="#{h @conf['google_map.key']}" size="50"></p>
|
97
|
+
HTML
|
86
98
|
end
|
87
99
|
|
88
100
|
def google_map_script(hash)
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
101
|
+
str = ''
|
102
|
+
str << %Q|google.maps.event.addDomListener(window, 'load', function() {\n|
|
103
|
+
str << %Q| var mapdiv = document.getElementById("#{hash[:id]}");\n|
|
104
|
+
str << %Q| if(mapdiv){\n|
|
105
|
+
str << %Q| var myOptions = {\n|
|
106
|
+
str << %Q| zoom: #{hash[:zoom]},\n|
|
107
|
+
str << %Q| overviewMapControl: #{hash[:overview]},\n|
|
108
|
+
str << %Q| overviewMapControlOptions: {\n|
|
109
|
+
str << %Q| opened: #{hash[:overview]}\n|
|
110
|
+
str << %Q| },\n|
|
111
|
+
str << %Q| center: new google.maps.LatLng(#{hash[:lat]}, #{hash[:lon]}),\n|
|
112
|
+
str << %Q| mapTypeId: google.maps.MapTypeId.#{hash[:type]},\n|
|
113
|
+
str << %Q| scaleControl: true\n|
|
114
|
+
str << %Q| };\n|
|
115
|
+
str << %Q| var gMap = new google.maps.Map(mapdiv, myOptions);\n|
|
116
|
+
# set Marker
|
117
|
+
if hash[:title]
|
118
|
+
str << %Q| var marker = new google.maps.Marker({\n|
|
119
|
+
str << %Q| position: new google.maps.LatLng(#{hash[:lat]}, #{hash[:lon]}),\n|
|
120
|
+
str << %Q| map: gMap,\n|
|
121
|
+
str << %Q| title: '#{hash[:title]}'\n|
|
122
|
+
str << %Q| });\n|
|
123
|
+
# set InfoWindow
|
124
|
+
if hash[:html]
|
125
|
+
str << %Q| var infowindow = new google.maps.InfoWindow({\n|
|
126
|
+
str << %Q| content: '<span style="color: #000000;">#{hash[:html]}</span>',\n|
|
127
|
+
str << %Q| size: new google.maps.Size(350, 200)\n|
|
128
|
+
str << %Q| });\n|
|
129
|
+
str << %Q| infowindow.open(gMap, marker);\n|
|
130
|
+
end # :html
|
131
|
+
end # :title
|
132
|
+
str << %Q| };\n|
|
133
|
+
str << %Q|});\n|
|
134
|
+
|
135
|
+
str
|
124
136
|
end
|
125
137
|
|
126
138
|
def google_geomap_script(hash)
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
139
|
+
str = ''
|
140
|
+
str << %Q|google.maps.event.addDomListener(window, 'load', function() {\n|
|
141
|
+
str << %Q| var mapdiv = document.getElementById("#{hash[:id]}");\n|
|
142
|
+
str << %Q| if(mapdiv){\n|
|
143
|
+
str << %Q| var geocoder = new google.maps.Geocoder();\n|
|
144
|
+
str << %Q| if(geocoder) {\n|
|
145
|
+
str << %Q| geocoder.geocode( { 'address': '#{hash[:address]}'}, function(results, status) {\n|
|
146
|
+
str << %Q| if (status == google.maps.GeocoderStatus.OK) {\n|
|
147
|
+
str << %Q| var geoLat = results[0].geometry.location;\n|
|
148
|
+
str << %Q| var myOptions = {\n|
|
149
|
+
str << %Q| zoom: #{hash[:zoom]},\n|
|
150
|
+
str << %Q| overviewMapControl: #{hash[:overview]},\n|
|
151
|
+
str << %Q| overviewMapControlOptions: {\n|
|
152
|
+
str << %Q| opened: #{hash[:overview]}\n|
|
153
|
+
str << %Q| },\n|
|
154
|
+
str << %Q| center: geoLat,\n|
|
155
|
+
str << %Q| mapTypeId: google.maps.MapTypeId.#{hash[:type]},\n|
|
156
|
+
str << %Q| scaleControl: true\n|
|
157
|
+
str << %Q| };\n|
|
158
|
+
str << %Q| var gMap = new google.maps.Map(mapdiv, myOptions);\n|
|
159
|
+
# set Marker
|
160
|
+
if hash[:title]
|
161
|
+
str << %Q| var marker = new google.maps.Marker({\n|
|
162
|
+
str << %Q| position: geoLat,\n|
|
163
|
+
str << %Q| map: gMap,\n|
|
164
|
+
str << %Q| title: '#{hash[:title]}'\n|
|
165
|
+
str << %Q| });\n|
|
166
|
+
# set InfoWindow
|
167
|
+
if hash[:html]
|
168
|
+
str << %Q| var infowindow = new google.maps.InfoWindow({\n|
|
169
|
+
str << %Q| content: '<span style="color: #000000;">#{hash[:html]}</span>',\n|
|
170
|
+
str << %Q| size: new google.maps.Size(350, 200)\n|
|
171
|
+
str << %Q| });\n|
|
172
|
+
str << %Q| infowindow.open(gMap, marker);\n|
|
173
|
+
end # :html
|
174
|
+
end # :title
|
175
|
+
str << %Q| }else{\n|
|
176
|
+
str << %Q| alert("Geocode was not successful for the following reason: " + status)\n|
|
177
|
+
str << %Q| }\n|
|
178
|
+
str << %Q| });\n|
|
179
|
+
str << %Q| }\n|
|
180
|
+
str << %Q| }\n|
|
181
|
+
str << %Q|});\n|
|
182
|
+
|
183
|
+
str
|
172
184
|
end
|
173
185
|
|
174
186
|
# Local Variables:
|
data/plugin/hb_footer.rb
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
# Author: ishinao <ishinao@ishinao.net>
|
9
9
|
#
|
10
10
|
|
11
|
-
add_body_leave_proc
|
11
|
+
add_body_leave_proc do |date|
|
12
12
|
if @mode == 'day' or @mode == 'latest'
|
13
13
|
diary = @diaries[date.strftime('%Y%m%d')]
|
14
14
|
pnum = 1
|
@@ -33,7 +33,7 @@ add_body_leave_proc(Proc.new do |date|
|
|
33
33
|
else
|
34
34
|
''
|
35
35
|
end
|
36
|
-
end
|
36
|
+
end
|
37
37
|
|
38
38
|
# rss-recent.rb: RSS recent plugin
|
39
39
|
#
|
data/plugin/image_ex.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
# image_plugin_ex.rb
|
2
3
|
# version 0.3
|
3
4
|
# -pv-
|
@@ -86,11 +87,11 @@
|
|
86
87
|
|
87
88
|
enable_js("image_ex.js")
|
88
89
|
|
89
|
-
add_body_enter_proc
|
90
|
+
add_body_enter_proc do |date|
|
90
91
|
@image_date = date.strftime("%Y%m%d")
|
91
92
|
@image_year = date.strftime("%Y")
|
92
93
|
""
|
93
|
-
end
|
94
|
+
end
|
94
95
|
|
95
96
|
|
96
97
|
def image( id, alt = "image", id2 = nil, width = nil, place="none" )
|
@@ -199,7 +200,7 @@ add_form_proc do |date|
|
|
199
200
|
imageex_convertedsize = %Q[#{imageex_convertedheight}x#{imageex_convertedwidth}]
|
200
201
|
imageex_convertedsize
|
201
202
|
end
|
202
|
-
system(imageex_convertpath , "-geometry", imageex_convertedsize , orig, new)
|
203
|
+
system(imageex_convertpath , "-auto-orient", "-geometry", imageex_convertedsize , orig, new)
|
203
204
|
if FileTest::size?( new ) == 0
|
204
205
|
File::delete( new )
|
205
206
|
end
|
data/plugin/instagram.rb
CHANGED
@@ -10,7 +10,6 @@ require 'uri'
|
|
10
10
|
require 'net/http'
|
11
11
|
require 'open-uri'
|
12
12
|
|
13
|
-
|
14
13
|
def instagram(*args)
|
15
14
|
uri = URI::parse(args[0])
|
16
15
|
return instagram_iframe(*args) if uri.scheme.nil?
|
@@ -19,7 +18,9 @@ end
|
|
19
18
|
|
20
19
|
def instagram_iframe(code, width=612, height=700)
|
21
20
|
return <<-BODY
|
22
|
-
<
|
21
|
+
<div class="embed embed-instagram">
|
22
|
+
<iframe src="//instagram.com/p/#{code}/embed/" width="#{width}" height="#{height}" frameborder="0" scrolling="no" allowtransparency="true"></iframe>
|
23
|
+
</div>
|
23
24
|
BODY
|
24
25
|
end
|
25
26
|
|
data/plugin/mm_footer.rb
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
require 'nkf'
|
11
11
|
|
12
|
-
add_body_leave_proc
|
12
|
+
add_body_leave_proc do |date|
|
13
13
|
|
14
14
|
oldest_date = Time.local(2005, 1, 11)
|
15
15
|
if date > oldest_date
|
@@ -38,7 +38,7 @@ add_body_leave_proc(Proc.new do |date|
|
|
38
38
|
''
|
39
39
|
end
|
40
40
|
end
|
41
|
-
end
|
41
|
+
end
|
42
42
|
|
43
43
|
require "rss/rss"
|
44
44
|
|
data/plugin/my_hotentry.rb
CHANGED
@@ -39,7 +39,7 @@ class MyHotEntry
|
|
39
39
|
# RSSを取得
|
40
40
|
rss = nil
|
41
41
|
rss_url = 'http://b.hatena.ne.jp/entrylist?mode=rss&url='
|
42
|
-
rss_url <<
|
42
|
+
rss_url << CGI.escape(base_url)
|
43
43
|
rss_url << "&sort=#{options[:sort]}&threshold=#{options[:threshold]}"
|
44
44
|
begin
|
45
45
|
Timeout.timeout(5) do
|
data/plugin/notify_miniblog.rb
CHANGED
@@ -53,7 +53,7 @@ def notify_miniblog
|
|
53
53
|
|
54
54
|
# strip category
|
55
55
|
sectitle.gsub!(/\[[^\]]+\] */, '')
|
56
|
-
url =
|
56
|
+
url = CGI.escape(@conf.base_url + anchor("#{date}p%02d" % index))
|
57
57
|
prefix = @conf['miniblog.notify.prefix']
|
58
58
|
format = @conf['miniblog.notify.format']
|
59
59
|
source = 'tdiary/notify_miniblog.rb'
|
data/plugin/socialbutton.rb
CHANGED
@@ -52,9 +52,9 @@ end
|
|
52
52
|
if @mode =~ /^(latest|day|month|nyear)$/
|
53
53
|
socialbutton_footer = Proc.new { %Q|<div class="socialbuttons"></div>| }
|
54
54
|
if respond_to?(:blogkit?) && blogkit?
|
55
|
-
add_body_leave_proc(socialbutton_footer)
|
55
|
+
add_body_leave_proc(&socialbutton_footer)
|
56
56
|
else
|
57
|
-
add_section_leave_proc(socialbutton_footer)
|
57
|
+
add_section_leave_proc(&socialbutton_footer)
|
58
58
|
end
|
59
59
|
|
60
60
|
# load javascript
|
data/plugin/tweet_quote.rb
CHANGED
@@ -29,7 +29,6 @@ end
|
|
29
29
|
|
30
30
|
def twitter_statuses_show_api( tweet_id )
|
31
31
|
url = "https://api.twitter.com/1.1/statuses/show.json"
|
32
|
-
unsafe = /[^a-zA-Z0-9\-\.\_\~]/
|
33
32
|
parameters = {
|
34
33
|
:id => tweet_id
|
35
34
|
}
|
@@ -41,11 +40,11 @@ def twitter_statuses_show_api( tweet_id )
|
|
41
40
|
:oauth_token => @conf["twitter_quote.oauth_token"],
|
42
41
|
:oauth_version => "1.0"
|
43
42
|
}
|
44
|
-
data = "GET&#{
|
45
|
-
data <<
|
43
|
+
data = "GET&#{CGI.escape( url )}&"
|
44
|
+
data << CGI.escape( oauth_parameters.merge( parameters ).sort.map{|k, v| "#{k}=#{v}" }.join( "&" ) )
|
46
45
|
oauth_parameters[:oauth_signature] = [OpenSSL::HMAC.digest(
|
47
46
|
OpenSSL::Digest::SHA1.new,
|
48
|
-
|
47
|
+
CGI.escape( "#{@conf["twitter_quote.oauth_consumer_secret"]}&#{@conf["twitter_quote.oauth_token_secret"]}" ),
|
49
48
|
data
|
50
49
|
)].pack( "m" ).chomp
|
51
50
|
|
@@ -53,7 +52,7 @@ def twitter_statuses_show_api( tweet_id )
|
|
53
52
|
proxy = 'http://' + proxy if proxy
|
54
53
|
|
55
54
|
headers = {
|
56
|
-
"Authorization" => %Q[OAuth #{oauth_parameters.map{|k ,v| "#{
|
55
|
+
"Authorization" => %Q[OAuth #{oauth_parameters.map{|k ,v| "#{CGI.escape( k.to_s )}=\"#{CGI.escape( v )}\""}.join( "," )}],
|
57
56
|
:proxy => proxy
|
58
57
|
}
|
59
58
|
Timeout.timeout( 20 ) do
|
data/plugin/yahoo_kousei.rb
CHANGED
@@ -26,7 +26,7 @@ Net::HTTP.version_1_2
|
|
26
26
|
def kousei_api( sentence )
|
27
27
|
appid = @conf['yahoo_kousei.appid']
|
28
28
|
|
29
|
-
query = "appid=#{appid}&sentence=#{
|
29
|
+
query = "appid=#{appid}&sentence=#{CGI.escape( sentence.gsub( /\n/, '' ) )}"
|
30
30
|
query << "&filter_group=" + @conf['yahoo_kousei.filter_group'] if @conf['yahoo_kousei.filter_group']
|
31
31
|
query << "&no_filter=" + @conf['yahoo_kousei.no_filter'] if @conf['yahoo_kousei.no_filter']
|
32
32
|
|
data/plugin/yo_update.rb
CHANGED
@@ -100,7 +100,7 @@ def yo_update_subscribers_count
|
|
100
100
|
raise YoUpdateError, "Yo API Key is not set"
|
101
101
|
end
|
102
102
|
req = Net::HTTP::Get.new(
|
103
|
-
URI("http://api.justyo.co/subscribers_count/?api_token=#{
|
103
|
+
URI("http://api.justyo.co/subscribers_count/?api_token=#{CGI.escape(api_key)}")
|
104
104
|
)
|
105
105
|
res = yo_update_access_api(req)
|
106
106
|
data = res.body
|
data/spec/spec_helper.rb
CHANGED
@@ -49,19 +49,19 @@ class PluginFake
|
|
49
49
|
@conf_procs << block
|
50
50
|
end
|
51
51
|
|
52
|
-
def add_edit_proc(
|
52
|
+
def add_edit_proc(&block)
|
53
53
|
@edit_procs << block
|
54
54
|
end
|
55
55
|
|
56
|
-
def add_header_proc(
|
56
|
+
def add_header_proc(&block)
|
57
57
|
@header_procs << block
|
58
58
|
end
|
59
59
|
|
60
|
-
def add_footer_proc(
|
60
|
+
def add_footer_proc(&block)
|
61
61
|
@footer_procs << block
|
62
62
|
end
|
63
63
|
|
64
|
-
def add_update_proc(
|
64
|
+
def add_update_proc(&block)
|
65
65
|
@update_procs << block
|
66
66
|
end
|
67
67
|
|
@@ -89,7 +89,7 @@ class PluginFake
|
|
89
89
|
r.join.chomp
|
90
90
|
end
|
91
91
|
|
92
|
-
def add_body_enter_proc(
|
92
|
+
def add_body_enter_proc(&block)
|
93
93
|
@body_enter_procs << block
|
94
94
|
end
|
95
95
|
|
@@ -101,7 +101,7 @@ class PluginFake
|
|
101
101
|
r.join.chomp
|
102
102
|
end
|
103
103
|
|
104
|
-
def add_body_leave_proc(
|
104
|
+
def add_body_leave_proc(&block)
|
105
105
|
@body_leave_procs << block
|
106
106
|
end
|
107
107
|
|
data/style/hatena_style.rb
CHANGED
@@ -844,7 +844,7 @@ class Hatena::Google
|
|
844
844
|
end
|
845
845
|
|
846
846
|
def convert(mode)
|
847
|
-
uri = 'http://www.google.com/search?q=%s&ie=euc-jp&oe=euc-jp' %
|
847
|
+
uri = 'http://www.google.com/search?q=%s&ie=euc-jp&oe=euc-jp' % CGI.escape(@str)
|
848
848
|
return uri unless @tag_p
|
849
849
|
template=nil
|
850
850
|
if mode == :CHTML
|
@@ -889,7 +889,7 @@ class Hatena::Keyword
|
|
889
889
|
end
|
890
890
|
|
891
891
|
def convert(mode)
|
892
|
-
uri = '%skeyword/%s' % [@group,
|
892
|
+
uri = '%skeyword/%s' % [@group, CGI.escape(@str)]
|
893
893
|
return uri unless @tag_p
|
894
894
|
template=nil
|
895
895
|
if mode == :CHTML
|
@@ -958,7 +958,7 @@ class Hatena::AmazonSearch
|
|
958
958
|
end
|
959
959
|
|
960
960
|
def convert(mode)
|
961
|
-
uri = 'http://www.amazon.co.jp/exec/obidos/external-search?mode=blended&tag=%s&encoding-string-jp=%%c6%%fc%%cb%%dc%%b8%%ec&keyword=%s' % [Hatena.conf['amazon.aid'] || '',
|
961
|
+
uri = 'http://www.amazon.co.jp/exec/obidos/external-search?mode=blended&tag=%s&encoding-string-jp=%%c6%%fc%%cb%%dc%%b8%%ec&keyword=%s' % [Hatena.conf['amazon.aid'] || '', CGI.escape(@str)]
|
962
962
|
return uri unless @tag_p
|
963
963
|
template=nil
|
964
964
|
if mode == :CHTML
|
@@ -259,10 +259,10 @@ end
|
|
259
259
|
# Callback Functions
|
260
260
|
|
261
261
|
# this is for view_exif().
|
262
|
-
add_body_enter_proc
|
262
|
+
add_body_enter_proc do |date|
|
263
263
|
@image_date_exif = date.strftime("%Y%m%d")
|
264
264
|
""
|
265
|
-
end
|
265
|
+
end
|
266
266
|
|
267
267
|
# Update Proc of the plugin
|
268
268
|
add_update_proc do
|
data/util/tdiary-grep/grep.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tdiary-contrib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tDiary contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tdiary
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '5.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '5.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pushbullet_ruby
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -42,16 +42,22 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.3'
|
48
|
+
- - "<"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '3.0'
|
48
51
|
type: :development
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
52
|
-
- - "
|
55
|
+
- - ">="
|
53
56
|
- !ruby/object:Gem::Version
|
54
57
|
version: '1.3'
|
58
|
+
- - "<"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '3.0'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: rake
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -507,7 +513,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
507
513
|
- !ruby/object:Gem::Version
|
508
514
|
version: '0'
|
509
515
|
requirements: []
|
510
|
-
rubygems_version: 3.
|
516
|
+
rubygems_version: 3.1.2
|
511
517
|
signing_key:
|
512
518
|
specification_version: 4
|
513
519
|
summary: tDiary contributions package
|