mns_subscriber 0.6.0 → 0.7.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
- checksums.yaml.gz.sig +0 -0
- data/lib/mns_subscriber.rb +425 -160
- data.tar.gz.sig +0 -0
- metadata +40 -20
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2ddc06764160255bf154806e01be715caa37041f21966e01d79b75e6329639b
|
4
|
+
data.tar.gz: 18c8c1b25c56b449761ab622742219a5b10a7f485e907902027d3303c0c2e069
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12c18783de474d14ba80b5baefaea3aad9c1dae802ae48e1c0d80cf4787c07a07f394c12b1619390aac611cf804757c733d0f429cf0903eadc4d1b543b81c4d3
|
7
|
+
data.tar.gz: a0779ad109d9f9347ec6f298a5ca490a54507294c542d8c27908df8835debd5d3f846fcae13e8626d37d791d684ae178fe1dab03ebc1b2fda871f60a65ef2042
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/mns_subscriber.rb
CHANGED
@@ -7,179 +7,444 @@ require 'mtlite'
|
|
7
7
|
require 'sps-sub'
|
8
8
|
require 'daily_notices'
|
9
9
|
require 'recordx_sqlite'
|
10
|
+
require 'easyimg_utils'
|
10
11
|
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
def initialize(host: 'sps', port: 59000, dir: '.', options: {},
|
15
|
-
timeline: nil, log: nil)
|
16
|
-
|
17
|
-
@log = log
|
18
|
-
log.info 'mns_subscriber/initialize: active' if log
|
19
|
-
|
20
|
-
# note: a valid url_base must be provided
|
21
|
-
|
22
|
-
@options = {
|
23
|
-
url_base: 'http://yourwebsitehere.co.uk/',
|
24
|
-
dx_xslt: '/xsl/dynarex.xsl',
|
25
|
-
rss_xslt: '/xsl/feed.xsl',
|
26
|
-
target_page: :page,
|
27
|
-
target_xslt: '/xsl/page.xsl'
|
28
|
-
}.merge(options)
|
29
|
-
|
30
|
-
super(host: host, port: port, log: log)
|
31
|
-
@filepath, @timeline = dir, timeline
|
32
|
-
|
33
|
-
@index = nil
|
13
|
+
module MNSSubscriber
|
34
14
|
|
35
|
-
|
15
|
+
class NoticeMgr
|
16
|
+
include RXFHelperModule
|
17
|
+
using ColouredText
|
36
18
|
|
37
|
-
|
38
|
-
|
39
|
-
end
|
19
|
+
def initialize(sps=nil, dir: '.', options: {}, timeline: nil,
|
20
|
+
hashtag_url: nil, log: nil, debug: false)
|
40
21
|
|
41
|
-
|
42
|
-
|
43
|
-
def ontopic(topic, msg)
|
44
|
-
|
45
|
-
@log.info 'mns_subscriber/ontopic: topic: ' + topic.inspect if @topic
|
46
|
-
|
47
|
-
a = topic.split('/')
|
48
|
-
puts "%s: %s %s" % [topic, Time.now.to_s, msg.inspect]
|
49
|
-
|
50
|
-
|
51
|
-
case a.last.to_sym
|
52
|
-
|
53
|
-
when :profile
|
54
|
-
|
55
|
-
update_attributes(:description, subtopic=a[-2], profile=msg)
|
56
|
-
|
57
|
-
when :link
|
58
|
-
|
59
|
-
update_attributes(:link, subtopic=a[-2], link=msg)
|
60
|
-
|
61
|
-
when :title
|
62
|
-
|
63
|
-
update_attributes(:title, subtopic=a[-2], title=msg)
|
64
|
-
|
65
|
-
when :image
|
66
|
-
|
67
|
-
update_attributes(:image, subtopic=a[-2], title=msg)
|
68
|
-
|
69
|
-
when :delete
|
70
|
-
|
71
|
-
delete_notice(subtopic=a[-2], msg)
|
72
|
-
|
73
|
-
else
|
74
|
-
|
75
|
-
subtopic, id = a[1..-1]
|
76
|
-
add_notice(subtopic, msg, id)
|
77
|
-
|
78
|
-
end
|
22
|
+
@sps, @log, @debug = sps, log, debug
|
79
23
|
|
80
|
-
|
24
|
+
# note: a valid url_base must be provided
|
25
|
+
@options = {
|
26
|
+
url_base: 'http://yourwebsitehere.co.uk/',
|
27
|
+
dx_xslt: '/xsl/dynarex.xsl',
|
28
|
+
rss_xslt: '/xsl/feed.xsl',
|
29
|
+
target_page: :page,
|
30
|
+
target_xslt: '/xsl/page.xsl',
|
31
|
+
local_media_path: '/home/user/media',
|
32
|
+
url_media_path: 'http://media.yourwebsitehere.co.uk/'
|
33
|
+
}.merge(options)
|
34
|
+
|
35
|
+
|
36
|
+
@filepath, @timeline = dir, timeline
|
37
|
+
|
38
|
+
@index = nil
|
39
|
+
@hashtags = nil
|
40
|
+
|
41
|
+
|
42
|
+
if hashtag_url then
|
43
|
+
|
44
|
+
@hashtag_url = @options[:url_base] + hashtag_url.sub(/^\//,'')
|
45
|
+
|
46
|
+
hashtag_path = File.join(dir, 'hashtag')
|
47
|
+
tagdb = File.join(hashtag_path, 'index.db')
|
48
|
+
FileX.mkdir_p File.dirname(tagdb)
|
81
49
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
notices = DailyNotices.new topic_dir, @options.merge(identifier: topic,
|
87
|
-
title: topic.capitalize + ' daily notices', log: @log)
|
88
|
-
|
89
|
-
id = (raw_id || Time.now).to_i
|
90
|
-
|
91
|
-
# strip out any JSON from the end of the message
|
92
|
-
msg, raw_json = raw_msg.split(/(?=\{.*)/)
|
93
|
-
|
94
|
-
mtlite = MTLite.new(msg)
|
95
|
-
|
96
|
-
desc = if mtlite.to_html(para: false) =~ /<\w+/ then
|
97
|
-
mtlite.to_html(para: true, ignore_domainlabel:true)
|
98
|
-
else
|
99
|
-
mtlite.to_s
|
50
|
+
h = {hashtags: {id: '', tag: '', topic: '', noticeid: ''}}
|
51
|
+
@hashtags = RecordxSqlite.new(tagdb, table: h )
|
52
|
+
|
53
|
+
end
|
100
54
|
end
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
55
|
+
|
56
|
+
def incoming(topic, msg)
|
57
|
+
|
58
|
+
a = topic.split('/')
|
59
|
+
context = a.last.to_sym
|
60
|
+
|
61
|
+
case context
|
62
|
+
when :profile
|
63
|
+
|
64
|
+
#update_attributes(:description, subtopic=a[-2], profile=msg)
|
65
|
+
h = JSON.parse msg, symbolize_names: true
|
66
|
+
update_profile(subtopic=a[-2], h)
|
67
|
+
|
68
|
+
when :link
|
69
|
+
puts 'we have a link' if @debug
|
70
|
+
update_attributes(:link, subtopic=a[-2], link=msg)
|
71
|
+
|
72
|
+
when :title
|
73
|
+
|
74
|
+
update_attributes(:title, subtopic=a[-2], title=msg)
|
75
|
+
|
76
|
+
when :image
|
77
|
+
#puts 'we have an image'
|
78
|
+
update_attributes(:image, subtopic=a[-2], title=msg)
|
79
|
+
|
80
|
+
when :delete
|
81
|
+
|
82
|
+
delete_notice(subtopic=a[-2], msg)
|
83
|
+
|
84
|
+
when :json
|
85
|
+
|
86
|
+
# JSON contains a message and 1 or more media files
|
87
|
+
h = JSON.parse msg, symbolize_names: true
|
88
|
+
puts 'h: ' + h.inspect if @debug
|
89
|
+
|
90
|
+
subtopic = a[-2]
|
91
|
+
|
92
|
+
t = Time.now
|
93
|
+
id = t.to_i.to_s + t.strftime("%2N")
|
94
|
+
|
95
|
+
filepath = File.join(@options[:local_media_path], 'images')
|
96
|
+
|
97
|
+
a = h[:files].map.with_index do |f,i|
|
98
|
+
|
99
|
+
# is f an Array object containing various sized images of the 1 file?
|
100
|
+
a2 = f.is_a?(Array) ? f : [f]
|
101
|
+
|
102
|
+
scale = a2.map do |imgfile|
|
103
|
+
|
104
|
+
scale = imgfile[/(_\w+)\.\w+$/,1].to_s
|
105
|
+
file = "%s%s%s" % [(id.to_i + i+1).to_s(36).reverse, scale, File.extname(imgfile)]
|
106
|
+
dest = File.join(filepath, file)
|
107
|
+
|
108
|
+
FileX.cp imgfile, dest
|
109
|
+
FileX.chmod 0755, dest
|
110
|
+
|
111
|
+
file
|
112
|
+
|
113
|
+
end
|
114
|
+
puts 'scale: ' + scale.inspect
|
115
|
+
index = scale[2] ? 2 : (scale[1] ? 1 : 0)
|
116
|
+
file1 = scale[index]
|
117
|
+
|
118
|
+
dir = File.extname(file1) =~ /\.(?:jpg|png)/ ? 'images' : ''
|
119
|
+
url = [@options[:url_media_path], dir, file1].join('/')
|
120
|
+
|
121
|
+
href = [@options[:url_base].sub(/\/$/,''), subtopic, 'status', id,
|
122
|
+
'photo', (i+1).to_s ].join('/')
|
123
|
+
# find the best y position for the image letterbox view
|
124
|
+
pct = EasyImgUtils.new(a2[index]).best_viewport
|
125
|
+
pct2 = (pct / 10.0).to_i * 10
|
126
|
+
|
127
|
+
align = if pct < 35 then
|
128
|
+
|
129
|
+
if pct < 10 then
|
130
|
+
:top
|
131
|
+
else
|
132
|
+
'y' + pct2.to_s
|
133
|
+
end
|
134
|
+
|
135
|
+
elsif pct >= 70
|
136
|
+
:bottom
|
137
|
+
else
|
138
|
+
#'y' + pct.to_s
|
139
|
+
:center
|
140
|
+
end
|
141
|
+
|
142
|
+
{url: url, align: align}
|
143
|
+
|
144
|
+
end
|
145
|
+
|
146
|
+
|
147
|
+
card = if h[:card] then
|
148
|
+
|
149
|
+
puts 'h[:card]: ' + h[:card].inspect
|
150
|
+
puts 'a: ' + a.inspect
|
151
|
+
|
152
|
+
if h[:card][:summary_large_image] then
|
153
|
+
|
154
|
+
h[:card][:summary_large_image][:img] = a[2][:url] if a.any?
|
155
|
+
h[:card]
|
156
|
+
|
157
|
+
elsif h[:card][:summary]
|
158
|
+
|
159
|
+
h[:card][:summary][:img] = a[0][:url] if a.any?
|
160
|
+
h[:card]
|
161
|
+
|
162
|
+
end
|
163
|
+
|
164
|
+
elsif a.any?
|
165
|
+
{images: a}
|
166
|
+
end
|
167
|
+
puts 'before build'
|
168
|
+
#puts ('card: ' + card.inspect).debug
|
169
|
+
|
170
|
+
h[:msg] += build(card) if card
|
171
|
+
add_notice(subtopic, h[:msg].gsub('<','<')\
|
172
|
+
.gsub('>','>').gsub("\r",''), id,
|
173
|
+
(card ? card.to_json : nil))
|
174
|
+
|
175
|
+
else
|
176
|
+
|
177
|
+
subtopic, id = a[1..-1]
|
178
|
+
add_notice(subtopic, msg, id)
|
179
|
+
|
180
|
+
end
|
122
181
|
end
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
182
|
+
|
183
|
+
private
|
184
|
+
|
185
|
+
def add_notice(topic, raw_msg, raw_id=nil, card=nil)
|
186
|
+
|
187
|
+
@log.info 'mns_subscriber/add_notice: active' if @log
|
188
|
+
topic_dir = File.join(@filepath, 'u', topic)
|
189
|
+
|
190
|
+
options = @options.clone
|
191
|
+
options.delete :local_media_path
|
192
|
+
options.delete :url_media_path
|
193
|
+
|
194
|
+
notices = DailyNotices.new topic_dir, options.merge(identifier: topic,
|
195
|
+
title: topic.capitalize + ' daily notices', log: @log)
|
196
|
+
|
197
|
+
t = Time.now
|
198
|
+
id = (raw_id || t.to_i.to_s + t.strftime("%2N")).to_i
|
199
|
+
|
200
|
+
# strip out any JSON from the end of the message
|
201
|
+
msg, raw_json = raw_msg.split(/(?=\{.*)/)
|
202
|
+
|
203
|
+
msg = ' ' if msg.nil?
|
204
|
+
mtlite = MTLite.new(msg)
|
205
|
+
|
206
|
+
desc = if mtlite.to_html(para: false) =~ /<\w+/ then
|
207
|
+
mtlite.to_html(para: true, ignore_domainlabel:true)
|
208
|
+
else
|
209
|
+
mtlite.to_s
|
210
|
+
end
|
211
|
+
|
212
|
+
if @hashtag_url then
|
213
|
+
|
214
|
+
tags = desc.scan(/(?<= #)\w+/)
|
215
|
+
|
216
|
+
desc.gsub!(/ [#\$][a-zA-Z]\w+/) do |rawx|
|
217
|
+
|
218
|
+
x = rawx.lstrip
|
219
|
+
baseurl = x[0] == '#' ? @hashtag_url : 'search?q='
|
220
|
+
url = baseurl + CGI.escape(x.sub(/^#/,''))
|
221
|
+
" <a href='%s'>%s</a>" % [url, x]
|
222
|
+
|
223
|
+
end
|
224
|
+
|
225
|
+
# add the record to the database
|
226
|
+
tags.each do |tag|
|
227
|
+
|
228
|
+
t = Time.now
|
229
|
+
id2 = (t.to_i.to_s + t.strftime("%2N")).to_i
|
230
|
+
h = {id: id2, tag: tag, topic: topic, noticeid: id}
|
231
|
+
|
232
|
+
@hashtags.create h if @hashtags
|
233
|
+
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|
237
|
+
|
238
|
+
title = mtlite.to_s.lines.first.chomp
|
239
|
+
title = title[0..136] + ' ...' if title.length > 140
|
240
|
+
|
241
|
+
h = {
|
242
|
+
title: title,
|
243
|
+
description: desc,
|
244
|
+
topic: topic,
|
245
|
+
card: card
|
246
|
+
}
|
247
|
+
#puts 'inside add_notice h: ' + h.inspect
|
248
|
+
return_status = notices.add(item: h, id: id.to_s)
|
249
|
+
#puts 'return_status: ' + return_status.inspect
|
250
|
+
|
251
|
+
return if return_status == :duplicate
|
252
|
+
|
253
|
+
rxnotices = RecordxSqlite.new(File.join(topic_dir, 'notices.db'),
|
254
|
+
table: {notices: {id: 0, description: '', message: ''}})
|
255
|
+
|
256
|
+
begin
|
257
|
+
rxnotices.create id: id.to_s, description: desc, message: msg
|
258
|
+
rescue
|
259
|
+
puts 'warning: rxnotices.create -> ' + ($!).inspect
|
260
|
+
end
|
261
|
+
|
262
|
+
if raw_json then
|
263
|
+
|
264
|
+
record = JSON.parse(raw_json)
|
265
|
+
index = RecordxSqlite.new(File.join(topic_dir, 'index.db'),
|
266
|
+
table: {items: record})
|
267
|
+
index.create record
|
268
|
+
|
269
|
+
update_index_xml(index, topic_dir)
|
270
|
+
|
271
|
+
end
|
272
|
+
|
273
|
+
@sps.notice "%s/add: %s/status/%s" % [@timeline, topic, id] if @timeline
|
274
|
+
|
275
|
+
sleep 0.3
|
276
|
+
|
133
277
|
end
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
278
|
+
|
279
|
+
def delete_notice(topic, msg)
|
280
|
+
|
281
|
+
topic_dir = File.join(@filepath, topic)
|
282
|
+
|
283
|
+
id = msg.to_i
|
284
|
+
|
285
|
+
feed = DailyNotices.new topic_dir, log: @log
|
286
|
+
feed.delete id
|
287
|
+
|
288
|
+
notices = RecordxSqlite.new(File.join(topic_dir, 'notices.db'),
|
289
|
+
table: 'notices')
|
290
|
+
notices.delete id
|
291
|
+
|
292
|
+
indexdb = File.join(topic_dir, 'index.db')
|
293
|
+
|
294
|
+
if File.exists? indexdb then
|
295
|
+
|
296
|
+
index = RecordxSqlite.new(indexdb, table: 'items')
|
297
|
+
index.delete id
|
298
|
+
update_index_xml(index, topic_dir)
|
299
|
+
end
|
300
|
+
|
157
301
|
end
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
302
|
+
|
303
|
+
# builds the HTML for a given card
|
304
|
+
#
|
305
|
+
def build(card)
|
306
|
+
puts 'inside build'
|
307
|
+
|
308
|
+
#return card.inspect
|
309
|
+
#next unless card.is_a? Hash
|
310
|
+
|
311
|
+
if card.is_a? Hash then
|
312
|
+
|
313
|
+
card2 = case card.keys.first
|
314
|
+
when :images
|
315
|
+
|
316
|
+
card[:images].map.with_index do |img, i|
|
317
|
+
|
318
|
+
"<img class='img1' src='%s'/>" % img[:url]
|
319
|
+
|
320
|
+
end.join
|
321
|
+
|
322
|
+
when :summary_large_image
|
323
|
+
|
324
|
+
h2 = card[:summary_large_image]
|
325
|
+
|
326
|
+
rawdesc = h2[:desc]
|
327
|
+
|
328
|
+
desc = rawdesc.length > 147 ? rawdesc[0..147] + '...' : rawdesc
|
329
|
+
site = h2[:url][/https?:\/\/([^\/]+)/,1].sub(/^www\./,'')
|
330
|
+
title = h2[:title]
|
331
|
+
img = h2[:img]
|
332
|
+
url = h2[:url]
|
333
|
+
|
334
|
+
# The following Card HTML template is for use with the RSS feed.
|
335
|
+
# The actual HTML template for the card is rendered dynamically
|
336
|
+
# from the web server.
|
337
|
+
"
|
338
|
+
<div class='card'><a href='#{url}' target='_blank'>" +
|
339
|
+
"<div class='top-crop center'><img src='#{img}'/></div>" +
|
340
|
+
"<span class='title'>#{title}</span></a><p>#{desc}</p>" +
|
341
|
+
"<span class='link'><span class='linkurl'>#{site}</span></span></div>"
|
342
|
+
|
343
|
+
when :summary
|
344
|
+
|
345
|
+
h2 = card[:summary]
|
346
|
+
puts 'h2: ' + h2.inspect
|
347
|
+
rawdesc = h2[:desc]
|
348
|
+
|
349
|
+
desc = rawdesc.length > 120 ? rawdesc[0..120] + '...' : rawdesc
|
350
|
+
site = h2[:url][/https?:\/\/([^\/]+)(?=\/)/,1].sub(/^www\./,'')
|
351
|
+
title = h2[:title]
|
352
|
+
img = h2[:img]
|
353
|
+
url = h2[:url]
|
354
|
+
|
355
|
+
# The following Card HTML template is for use with the RSS feed.
|
356
|
+
# The actual HTML template for the card is rendered dynamically
|
357
|
+
# from the web server.
|
358
|
+
|
359
|
+
"<div class='card2'><a href='#{url}' target='_blank'><div><div id='col1'>" +
|
360
|
+
"<img src='#{img}'></div><div id='col2'><div id='content'>" +
|
361
|
+
"<span class='title'>#{title}</span><span class='desc'>#{desc}</span>" +
|
362
|
+
"<span class='link'><span class='linkurl'>#{site}</span></span></div>" +
|
363
|
+
"</div></div></a></div>"
|
364
|
+
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
end
|
369
|
+
|
370
|
+
def update_index_xml(index, topic_dir)
|
371
|
+
|
372
|
+
# create the index.xml file
|
373
|
+
|
374
|
+
a = index.order(:desc).first(15)
|
375
|
+
a2 = a.map {|x| h = x.to_h; id = h.delete(:id); {item_id: id}.merge(h)}
|
376
|
+
|
377
|
+
dx = Dynarex.new
|
378
|
+
dx.import a2
|
379
|
+
dx.order ='descending'
|
380
|
+
|
381
|
+
dx.save File.join(topic_dir, 'index.xml')
|
382
|
+
|
383
|
+
end
|
384
|
+
|
385
|
+
def update_attributes(attribute, topic, value)
|
386
|
+
|
387
|
+
topic_dir = File.join(@filepath, topic)
|
388
|
+
notices = DailyNotices.new topic_dir, @options.merge(identifier: topic)
|
389
|
+
notices.method((attribute.to_s + '=').to_sym).call(value)
|
390
|
+
notices.save
|
391
|
+
|
392
|
+
end
|
393
|
+
|
394
|
+
def update_profile(topic, h)
|
395
|
+
|
396
|
+
topic_dir = File.join(@filepath, topic)
|
397
|
+
notices = DailyNotices.new topic_dir, @options.merge(identifier: topic)
|
398
|
+
|
399
|
+
valid_keys = %i(title identifier image bio location website banner_image)
|
400
|
+
|
401
|
+
h.each_pair do |key, value|
|
402
|
+
|
403
|
+
next unless valid_keys.include? key
|
404
|
+
|
405
|
+
attribute = key.to_s
|
406
|
+
notices.method((attribute + '=').to_sym).call(value)
|
407
|
+
|
408
|
+
end
|
409
|
+
|
410
|
+
notices.save
|
411
|
+
|
412
|
+
end
|
413
|
+
|
414
|
+
|
174
415
|
end
|
175
416
|
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
417
|
+
class Client < SPSSub
|
418
|
+
|
419
|
+
def initialize(host: 'sps', port: 59000, dir: '.', options: {},
|
420
|
+
timeline: nil, log: nil, hashtag_url: nil)
|
421
|
+
|
422
|
+
@log = log
|
423
|
+
log.info 'mns_subscriber/initialize: active' if log
|
424
|
+
@nm = NoticeMgr.new(self, dir: dir, options: options, timeline: timeline,
|
425
|
+
hashtag_url: hashtag_url, debug: true)
|
426
|
+
|
427
|
+
super(host: host, port: port, log: log)
|
428
|
+
|
429
|
+
end
|
430
|
+
|
431
|
+
def subscribe(topic='notice/*')
|
432
|
+
super(topic)
|
433
|
+
end
|
434
|
+
|
435
|
+
private
|
436
|
+
|
437
|
+
def ontopic(topic, msg)
|
438
|
+
|
439
|
+
@log.info 'mns_subscriber/ontopic: topic: ' + topic.inspect if @topic
|
440
|
+
|
441
|
+
a = topic.split('/')
|
442
|
+
#puts "%s: %s %s" % [topic, Time.now.to_s, msg.inspect]
|
443
|
+
|
444
|
+
@nm.incoming topic, msg
|
445
|
+
|
446
|
+
end
|
447
|
+
|
183
448
|
end
|
184
449
|
|
185
450
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mns_subscriber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,28 +35,28 @@ cert_chain:
|
|
35
35
|
yOAycOYzp7fxmPl3/HV5D0YOJwuy1XslA50GQJwq12A5vMyUGUCHuxH/zKZcM/zr
|
36
36
|
0QZaKiVqq5ZeGvni0eQSavhQ
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2022-01-17 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: mtlite
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- - ">="
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: 0.4.0
|
47
44
|
- - "~>"
|
48
45
|
- !ruby/object:Gem::Version
|
49
46
|
version: '0.4'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.4.1
|
50
50
|
type: :runtime
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - ">="
|
55
|
-
- !ruby/object:Gem::Version
|
56
|
-
version: 0.4.0
|
57
54
|
- - "~>"
|
58
55
|
- !ruby/object:Gem::Version
|
59
56
|
version: '0.4'
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 0.4.1
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: sps-sub
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|
@@ -81,44 +81,64 @@ dependencies:
|
|
81
81
|
name: daily_notices
|
82
82
|
requirement: !ruby/object:Gem::Requirement
|
83
83
|
requirements:
|
84
|
-
- - ">="
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version: 0.7.0
|
87
84
|
- - "~>"
|
88
85
|
- !ruby/object:Gem::Version
|
89
86
|
version: '0.7'
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.7.2
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 0.7.0
|
97
94
|
- - "~>"
|
98
95
|
- !ruby/object:Gem::Version
|
99
96
|
version: '0.7'
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: 0.7.2
|
100
100
|
- !ruby/object:Gem::Dependency
|
101
101
|
name: recordx_sqlite
|
102
102
|
requirement: !ruby/object:Gem::Requirement
|
103
103
|
requirements:
|
104
|
-
- - ">="
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
version: 0.3.0
|
107
104
|
- - "~>"
|
108
105
|
- !ruby/object:Gem::Version
|
109
106
|
version: '0.3'
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.3.3
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0.3'
|
114
117
|
- - ">="
|
115
118
|
- !ruby/object:Gem::Version
|
116
|
-
version: 0.3.
|
119
|
+
version: 0.3.3
|
120
|
+
- !ruby/object:Gem::Dependency
|
121
|
+
name: easyimg_utils
|
122
|
+
requirement: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
117
124
|
- - "~>"
|
118
125
|
- !ruby/object:Gem::Version
|
119
|
-
version: '0.
|
126
|
+
version: '0.7'
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: 0.7.4
|
130
|
+
type: :runtime
|
131
|
+
prerelease: false
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - "~>"
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '0.7'
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: 0.7.4
|
120
140
|
description:
|
121
|
-
email:
|
141
|
+
email: digital.robertson@gmail.com
|
122
142
|
executables: []
|
123
143
|
extensions: []
|
124
144
|
extra_rdoc_files: []
|
metadata.gz.sig
CHANGED
Binary file
|