rss_to_dynarex 0.1.0 → 0.1.1

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
2
  SHA1:
3
- metadata.gz: 4f2ca67f98c31e5f3ace1b8b7f37ef4ea095ee15
4
- data.tar.gz: 76b7adfb603351ef8907fee307240fd1853ec8b9
3
+ metadata.gz: e426a45b7a21e55a9835cee795ec447d08f6771c
4
+ data.tar.gz: 282191502cedd0c1f93959bd92890da6b5890447
5
5
  SHA512:
6
- metadata.gz: f77f03879a424b4fe3ccacecab98cf99b17b0e1a19945d7731cdae9c9627c83ccd02d1efd98958909f58a1a8c02ffa07013e164e57190b2a9444e9e07e16a74d
7
- data.tar.gz: 9c8ae5c7234282ea72acf23dbfe9bebf68327fc4e6cb64106f32374754cb23170b7dfd8967f09d3a55ba70932aae752a9483b0471b49a8e1d151345abedd8bb3
6
+ metadata.gz: d252005f628f0ffa7bcb2647fb1b0bb109ea082b36f2e6f43b1af82ac4648f6e0b4d83ee06513ab9f1de6f3c7738ac64e433740326997af5db14080a14b4ee30
7
+ data.tar.gz: 9cec95ba6788eb1b5d0f0ed41dfd2140aa441fe08d1bb036305da30faf26fd89cf4af476b8cbddd848a8b542a352c73c33641c0c251c6839ff5b1accd84cdd40
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -0,0 +1,104 @@
1
+ <xsl:stylesheet
2
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
+
4
+ xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0"
5
+
6
+ xmlns:content = "http://purl.org/rss/1.0/modules/content/"
7
+
8
+ xmlns:feed="http://purl.org/atom/ns#"
9
+
10
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
11
+
12
+ xmlns:purl="http://purl.org/rss/1.0/"
13
+
14
+ xmlns:rss="http://purl.org/rss/1.0/"
15
+
16
+ exclude-result-prefixes="xsl feed rdf purl dc">
17
+
18
+
19
+
20
+ <xsl:output
21
+
22
+ method="xml"
23
+
24
+ indent="yes"
25
+
26
+ omit-xml-declaration="no"
27
+
28
+ encoding="UTF-8"
29
+
30
+ />
31
+
32
+
33
+
34
+
35
+
36
+ <xsl:template match="/feed:feed | /rss/channel | /rdf:RDF">
37
+
38
+ <xsl:element name="channel">
39
+
40
+
41
+
42
+ <xsl:element name="summary">
43
+ <xsl:element name="recordx_type">dynarex</xsl:element>
44
+ <xsl:element name="format_mask">[!link] [!title] [!date] [!description]</xsl:element>
45
+ <xsl:element name="schema">channel[recordx_type, format_mask, title, description, link]/item(link, title, date, description)</xsl:element>
46
+ <xsl:element name="title">
47
+ <xsl:value-of select="feed:title | purl:channel/purl:title | title"/>
48
+ </xsl:element>
49
+ <xsl:element name="description">
50
+
51
+ <xsl:value-of select="description"/>
52
+ </xsl:element>
53
+ <xsl:element name="link">
54
+ <xsl:value-of select="link"/>
55
+ </xsl:element>
56
+
57
+ </xsl:element>
58
+
59
+
60
+
61
+ <xsl:element name="records">
62
+
63
+ <xsl:apply-templates select="item | purl:item | feed:entry | rdf:RDF/rss:item" />
64
+
65
+ </xsl:element>
66
+ </xsl:element>
67
+
68
+ </xsl:template>
69
+
70
+
71
+
72
+
73
+
74
+ <xsl:template match="item | purl:item | feed:entry | rdf:RDF/rss:item">
75
+
76
+
77
+
78
+ <xsl:element name="item">
79
+
80
+ <xsl:element name="link">
81
+
82
+ <xsl:value-of select="feed:link/@href | purl:link | link"/>
83
+ </xsl:element>
84
+ <xsl:element name="title">
85
+
86
+ <xsl:value-of select="title | purl:title | feed:title" />
87
+
88
+ </xsl:element>
89
+
90
+ <xsl:element name="date">
91
+
92
+ <xsl:value-of select="feed:date | purl:date | dc:date | pubDate"/>
93
+ </xsl:element>
94
+
95
+ <xsl:element name="description">
96
+ <xsl:value-of disable-output-escaping="no" select="description | purl:description | feed:content"/>
97
+ </xsl:element>
98
+ </xsl:element>
99
+
100
+
101
+ </xsl:template>
102
+
103
+
104
+ </xsl:stylesheet>
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -67,7 +67,7 @@ executables: []
67
67
  extensions: []
68
68
  extra_rdoc_files: []
69
69
  files:
70
- - lib/rss_to_dynarex.rb
70
+ - lib/rss_to_dynarex.xsl
71
71
  homepage: https://github.com/jrobertson/rss_to_dynarex
72
72
  licenses:
73
73
  - MIT
metadata.gz.sig CHANGED
@@ -1,2 +1 @@
1
- ��
2
- �p��G*O+%�V,_ܦR�s����a���ZS{'L?1~�ɯ('�(Ȱ�@^$;�)��2|5=ͺB��D�����s
1
+ Gk����t�X@�!�8�M�:�|
@@ -1,29 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- # file: rss_to_dynarex.rb
4
-
5
- require 'dynarex'
6
- require 'nokogiri'
7
-
8
- class RSStoDynarex
9
-
10
- attr_reader :to_dynarex
11
-
12
- def initialize(url)
13
-
14
- lib = File.dirname(__FILE__)
15
- xsl_buffer = File.read(lib + '/rss_to_dynarex.xsl')
16
-
17
- xslt = Nokogiri::XSLT(xsl_buffer)
18
- doc = open(url, 'UserAgent' => 'RSStoDynarex')
19
- @to_dynarex = xslt.transform(Nokogiri::XML(doc.to_s))
20
- end
21
-
22
- end
23
-
24
- if __FILE__ == $0 then
25
-
26
- rtd = RSStoDynarex.new 'http://stallman.org/rss.xml'
27
- dynarex = rtd.to_dynarex
28
- dynarex.save 'rms.xml'
29
- end