liveblog-plugin-dxtags 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/liveblog-plugin-dxtags.rb +34 -2
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dc8c46e7268a510a8d92ff0ecd0fdbbc8ff04df
|
4
|
+
data.tar.gz: 7263bbabae11c42651b22a6fa9db2217b25966ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2cbf3af9c19b2431028a1f0e9ac633df90c76c745203064ec240e46381ffe76ace6e4a249f543f1c5d3b0a6f173da8571a3ba159538a736b4ec166a33fef784
|
7
|
+
data.tar.gz: 25d0e60e679d815911cef8d0a9586b73d63862813607018c4e45dcbc52d33993458e3b783fca76c94972d3a5f3551fbd23f46ecb6e9cc741e5d326c815d1eaad
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
@@ -18,7 +18,7 @@ class LiveBlogPluginDxTags
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def on_new_day(filepath, urlpath)
|
21
|
-
|
21
|
+
|
22
22
|
dxt = DynarexTags.new(@parent_filepath, tagfile_xslt: @tag_xsltpath)
|
23
23
|
|
24
24
|
dxt.generate(filepath) do |section|
|
@@ -42,6 +42,38 @@ class LiveBlogPluginDxTags
|
|
42
42
|
|
43
43
|
def on_new_section(raw_entry, hashtag)
|
44
44
|
|
45
|
+
# check the pxtags file (if it exists) for a matching hashtag
|
46
|
+
|
47
|
+
pxtagsfilepath = File.join(@parent_filepath, 'pxtags.xml')
|
48
|
+
|
49
|
+
|
50
|
+
if File.exists? pxtagsfilepath then
|
51
|
+
|
52
|
+
doc = Rexle.new File.read(pxtagsfilepath)
|
53
|
+
tags = doc.root.xpath("//tag[.='#{hashtag}']/text()").uniq
|
54
|
+
|
55
|
+
tags.each do |tag|
|
56
|
+
|
57
|
+
filepath = File.join(@parent_filepath, 'tags', tag + '.xml')
|
58
|
+
|
59
|
+
if File.exists? filepath then
|
60
|
+
|
61
|
+
dx = Dynarex.new filepath
|
62
|
+
recs = dx.to_h
|
63
|
+
|
64
|
+
pxfilepath = File.join(@todays_filepath, 'tags-seealso.xml')
|
65
|
+
px = Polyrex.new pxfilepath
|
66
|
+
px.create.tag( label: hashtag) {|create| recs.each {|h| create.entry h} }
|
67
|
+
px.save options: {pretty: true}
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
return if tags.any?
|
74
|
+
|
75
|
+
end
|
76
|
+
|
45
77
|
# check the dxtags file for any matching hashtags
|
46
78
|
|
47
79
|
filepath = File.join(@parent_filepath, 'tags', hashtag + '.xml')
|
@@ -109,4 +141,4 @@ class LiveBlogPluginDxTags
|
|
109
141
|
end
|
110
142
|
|
111
143
|
|
112
|
-
end
|
144
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liveblog-plugin-dxtags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
N4FNEHt4LyjhMIkH/Dpq5NOxOazGcql9I6CwBisvXhE0cyht9YSUjRO1uDvv6B/g
|
32
32
|
c4UKnHyLClIcQQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-
|
34
|
+
date: 2015-11-23 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dynarex-tags
|
metadata.gz.sig
CHANGED
Binary file
|