rss_to_dynarex 0.1.5 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5c55cd2aa589c8e72ebe54cf1fcc77470f4e931b
4
- data.tar.gz: f71358dcb5d9909a5d2b6ed3a94b9f29a2b343b6
2
+ SHA256:
3
+ metadata.gz: 594eeced35e0c1ad70ae81e44427eced9b6a051286e7e137dbc9945fa8466098
4
+ data.tar.gz: 2f92aff6b5443d9fe814b7dd4b528d8959c537f10ef53dc6df436078e38ddab0
5
5
  SHA512:
6
- metadata.gz: 6c53c09e25efa7a92fe13d80e88cc3589360c857be7b293cc24ed8d6a09705aa163e75c1ac47d90a35389a31730b1754ee6039d3317f65da316d77821dd69187
7
- data.tar.gz: 35085958ef352f4c353835cfe7b67964827fb945d38226817f987d40ecd2a9c7c37dc7a70b476a559236ddb21f747706fd5e7546329240765a0ce137e0c9a66c
6
+ metadata.gz: b1199d03c8f869d8a2c58bf7912099d5ffb2c65a2f21fe1112c16079ec7ed47360069bb54d694e6f0de0a3bf299c73c6763bc781c42a24bbf5cf0ba072ae9cdc
7
+ data.tar.gz: d2865924319f653b190677ba73b2939e34a1591e17959395a2578b3bd76651ea0158a66774c3c746e624000a57700ca92c92fee6bc063f53f7a7bdeb5c75b0ea
checksums.yaml.gz.sig CHANGED
Binary file
@@ -6,6 +6,7 @@ require 'dynarex'
6
6
  require 'nokogiri'
7
7
 
8
8
  class RSStoDynarex
9
+ include RXFReader
9
10
 
10
11
  attr_reader :to_dynarex
11
12
 
@@ -16,11 +17,12 @@ class RSStoDynarex
16
17
  #xsl_buffer = File.read('rss_to_dynarex.xsl')
17
18
 
18
19
  xslt = Nokogiri::XSLT(xsl_buffer)
19
- doc = open(url, 'UserAgent' => 'RSStoDynarex'){|x| x.read }
20
- doc.encode!('UTF-8', 'binary', invalid: :replace,
20
+ #doc = open(url, 'UserAgent' => 'RSStoDynarex'){|x| x.read }
21
+ doc = RXFReader.read(url).first
22
+ doc.encode!('UTF-8', 'binary', invalid: :replace,
21
23
  undef: :replace, replace: '')
22
24
  xml_buffer = xslt.transform(Nokogiri::XML(doc.to_s)).to_s
23
-
25
+
24
26
  @to_dynarex = Dynarex.new xml_buffer
25
27
  end
26
28
 
@@ -28,7 +30,7 @@ end
28
30
 
29
31
  if __FILE__ == $0 then
30
32
 
31
- rtd = RSStoDynarex.new 'http://stallman.org/rss/rss.xml'
33
+ rtd = RSStoDynarex.new 'https://stallman.org/rss/rss.xml'
32
34
  dynarex = rtd.to_dynarex
33
35
  dynarex.save 'rms.xml'
34
- end
36
+ end
@@ -5,53 +5,55 @@
5
5
 
6
6
  xmlns:content = "http://purl.org/rss/1.0/modules/content/"
7
7
 
8
- xmlns:feed="http://www.w3.org/2005/Atom"
8
+ xmlns:feed="http://www.w3.org/2005/Atom"
9
9
 
10
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
10
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
11
11
 
12
- xmlns:purl="http://purl.org/rss/1.0/"
12
+ xmlns:purl="http://purl.org/rss/1.0/"
13
13
 
14
- xmlns:rss="http://purl.org/rss/1.0/"
14
+ xmlns:rss="http://purl.org/rss/1.0/"
15
15
 
16
- exclude-result-prefixes="xsl feed rdf purl dc">
16
+ xmlns:atom="http://purl.org/atom/ns#"
17
17
 
18
+ exclude-result-prefixes="xsl feed rdf purl dc atom">
18
19
 
19
20
 
20
- <xsl:output
21
21
 
22
- method="xml"
22
+ <xsl:output
23
23
 
24
- indent="yes"
24
+ method="xml"
25
25
 
26
- omit-xml-declaration="no"
26
+ indent="yes"
27
27
 
28
- encoding="UTF-8"
28
+ omit-xml-declaration="no"
29
29
 
30
- />
30
+ encoding="UTF-8"
31
31
 
32
+ />
32
33
 
33
34
 
34
35
 
35
36
 
36
- <xsl:template match="/feed:feed | /rss/channel | /rdf:RDF">
37
37
 
38
- <xsl:element name="channel">
38
+ <xsl:template match="/feed:feed | /rss/channel | /rdf:RDF | /atom:feed">
39
39
 
40
-
40
+ <xsl:element name="channel">
41
+
42
+
41
43
 
42
44
  <xsl:element name="summary">
43
45
  <xsl:element name="recordx_type">dynarex</xsl:element>
44
46
  <xsl:element name="format_mask">[!link] [!title] [!date] [!description]</xsl:element>
45
47
  <xsl:element name="schema">channel[recordx_type, format_mask, title, description, link]/item(link, title, date, description)</xsl:element>
46
48
  <xsl:element name="title">
47
- <xsl:value-of select="feed:title | purl:channel/purl:title | title"/>
49
+ <xsl:value-of select="feed:title | purl:channel/purl:title | atom:title | title"/>
48
50
  </xsl:element>
49
51
  <xsl:element name="description">
50
52
 
51
- <xsl:value-of select="description"/>
53
+ <xsl:value-of select="description"/>
52
54
  </xsl:element>
53
55
  <xsl:element name="link">
54
- <xsl:value-of select="link"/>
56
+ <xsl:value-of select="link | atom:link/@href"/>
55
57
  </xsl:element>
56
58
 
57
59
  </xsl:element>
@@ -60,7 +62,7 @@
60
62
 
61
63
  <xsl:element name="records">
62
64
 
63
- <xsl:apply-templates select="item | purl:item | feed:entry | rdf:RDF/rss:item" />
65
+ <xsl:apply-templates select="item | purl:item | feed:entry | rdf:RDF/rss:item | atom:entry | entry" />
64
66
 
65
67
  </xsl:element>
66
68
  </xsl:element>
@@ -71,7 +73,7 @@
71
73
 
72
74
 
73
75
 
74
- <xsl:template match="item | purl:item | feed:entry | rdf:RDF/rss:item">
76
+ <xsl:template match="item | purl:item | feed:entry | rdf:RDF/rss:item | atom:entry | entry">
75
77
 
76
78
 
77
79
 
@@ -79,21 +81,21 @@
79
81
 
80
82
  <xsl:element name="link">
81
83
 
82
- <xsl:value-of select="feed:link/@href | purl:link | link"/>
84
+ <xsl:value-of disable-output-escaping="no" select="feed:link/@href | purl:link | atom:link/@href | link"/>
83
85
  </xsl:element>
84
86
  <xsl:element name="title">
85
87
 
86
- <xsl:value-of select="title | purl:title | feed:title" />
88
+ <xsl:value-of disable-output-escaping="no" select="title | purl:title | feed:title | atom:title" />
87
89
 
88
90
  </xsl:element>
89
91
 
90
92
  <xsl:element name="date">
91
93
 
92
- <xsl:value-of select="feed:date | purl:date | dc:date | pubDate"/>
94
+ <xsl:value-of select="feed:date | purl:date | dc:date | pubDate | atom:modified"/>
93
95
  </xsl:element>
94
96
 
95
97
  <xsl:element name="description">
96
- <xsl:value-of disable-output-escaping="no" select="description | purl:description | feed:content"/>
98
+ <xsl:value-of disable-output-escaping="no" select="description | purl:description | feed:content | atom:summary"/>
97
99
  </xsl:element>
98
100
  </xsl:element>
99
101
 
@@ -101,4 +103,4 @@
101
103
  </xsl:template>
102
104
 
103
105
 
104
- </xsl:stylesheet>
106
+ </xsl:stylesheet>
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rss_to_dynarex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -10,59 +10,75 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
- YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
- 8ixkARkWAmV1MB4XDTEzMTIwMjE5MDExN1oXDTE0MTIwMjE5MDExN1owSDESMBAG
16
- A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
- EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBAMr8Ir1dqN4hD/gNOxT0qouRa2BbgjavrHysrt54myIqEt+3wHCYj2PGEAcg
19
- npJDkQt2z92rAJ5fTOonPVubehMtozItmgc2HYJTkE0+sFsbKwolBswq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anP7h/B+/CAoYm10fMp+cHd
32
+ 89gD+ZMPjzhTPgWYxJVfXiL+7rwcJKSaVIKPVSZU9ljhE9CcWP5fu4dVtO/A0nNL
33
+ lD18/drmOjfXO1GLraD8QhxwgacGO3J0qjbmRm2fnLdoYnQJOg4ibrfFbT8TKhWd
34
+ Sm2+HX3fxFW78HtdINqJlskAdUAOHyWZq/yDgP5EbHq+YbZKltOwQuE+zzgsNVbG
35
+ yQK8ASnGq0Hi4RfBOnVTWrBLuqb8UfdjR6LjeFB+aHOveI1C5eaVJqR6pFyluJyx
36
+ CDha257gtkY1PoP2oINg2Svj
33
37
  -----END CERTIFICATE-----
34
- date: 2013-12-10 00:00:00.000000000 Z
38
+ date: 2022-02-22 00:00:00.000000000 Z
35
39
  dependencies:
36
40
  - !ruby/object:Gem::Dependency
37
41
  name: nokogiri
38
42
  requirement: !ruby/object:Gem::Requirement
39
43
  requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.13'
40
47
  - - ">="
41
48
  - !ruby/object:Gem::Version
42
- version: '0'
49
+ version: 1.13.3
43
50
  type: :runtime
44
51
  prerelease: false
45
52
  version_requirements: !ruby/object:Gem::Requirement
46
53
  requirements:
54
+ - - "~>"
55
+ - !ruby/object:Gem::Version
56
+ version: '1.13'
47
57
  - - ">="
48
58
  - !ruby/object:Gem::Version
49
- version: '0'
59
+ version: 1.13.3
50
60
  - !ruby/object:Gem::Dependency
51
61
  name: dynarex
52
62
  requirement: !ruby/object:Gem::Requirement
53
63
  requirements:
64
+ - - "~>"
65
+ - !ruby/object:Gem::Version
66
+ version: '1.9'
54
67
  - - ">="
55
68
  - !ruby/object:Gem::Version
56
- version: '0'
69
+ version: 1.9.5
57
70
  type: :runtime
58
71
  prerelease: false
59
72
  version_requirements: !ruby/object:Gem::Requirement
60
73
  requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '1.9'
61
77
  - - ">="
62
78
  - !ruby/object:Gem::Version
63
- version: '0'
79
+ version: 1.9.5
64
80
  description:
65
- email: james@r0bertson.co.uk
81
+ email: digital.robertson@gmail.com
66
82
  executables: []
67
83
  extensions: []
68
84
  extra_rdoc_files: []
@@ -81,15 +97,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
81
97
  requirements:
82
98
  - - ">="
83
99
  - !ruby/object:Gem::Version
84
- version: '0'
100
+ version: 2.1.2
85
101
  required_rubygems_version: !ruby/object:Gem::Requirement
86
102
  requirements:
87
103
  - - ">="
88
104
  - !ruby/object:Gem::Version
89
105
  version: '0'
90
106
  requirements: []
91
- rubyforge_project:
92
- rubygems_version: 2.0.0.rc.2
107
+ rubygems_version: 3.2.22
93
108
  signing_key:
94
109
  specification_version: 4
95
110
  summary: rss_to_dynarex
metadata.gz.sig CHANGED
@@ -1 +1,3 @@
1
- \�$&7��xk�H�Ro(�ɠ�Qk=6��[���"�١�黶�틹g%f�[J��Bh���6bi-���FMT����Iz>;���_��E,|�ilGS ��VD �����?tqCSa���<��ooKh���+1�;�*kKtf0��{s���=o~�� �� ����n���::|��l�@'*�'��f~����;P}9?Ǻsc��R}c�l� *��4\I�W�>��4���[��QѤ��~(I_f�%F�,
1
+ Q��+b&�4����kZt@�Y7)vqqxe��mb ����R 9
2
+ �`A�� �
3
+ &5�`R�Tq�"��hA��-��r���Y��;�u�]�#w��Y�8�e:}���Suս�����0��"X�� \s�-�9�^3N�rU��~L�VDa��Wܝ��J3z�ʼng��dE��8XK9����ѷ�~�Nl�x>�3�=