rss 0.3.1 → 0.3.2
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
- data/NEWS.md +17 -0
- data/README.md +8 -12
- data/lib/rss/rss.rb +1 -1
- data/lib/rss/version.rb +1 -1
- data/lib/rss/xml-stylesheet.rb +1 -1
- data/lib/rss/xml.rb +1 -1
- data/lib/rss.rb +6 -11
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2ab2e2eae9a7728b36476373e748eaf66ce357b857156f96f9afc366f747625
|
|
4
|
+
data.tar.gz: c92b1582e936b810d4725ca7498656a9e5014e78de7dc541b1a1825eb1b51480
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 05e252cb211146849b60519821e591cdd7e26031817c3ef091e706b28db2316550970b015a7fe36ea2c6921a79cdadbf150012de065398ce1a5be494dab97c0d
|
|
7
|
+
data.tar.gz: 9beba0ef3f14611f7ddbb62b58797e8f814b64bf454fa4cf1e21276d471464d47f91fad31cf1be51d7f5c2339ded75d2c3608fe20aca5e4851d373ac809de0fe
|
data/NEWS.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# News
|
|
2
2
|
|
|
3
|
+
## 0.3.2 - 2025-12-19
|
|
4
|
+
|
|
5
|
+
### Improvements
|
|
6
|
+
|
|
7
|
+
* Updated documents.
|
|
8
|
+
* GH-59
|
|
9
|
+
* Patch by 1s22s1.
|
|
10
|
+
|
|
11
|
+
* Added support for Ruby 4.0.0.
|
|
12
|
+
* GH-62
|
|
13
|
+
* Patch by Taketo Takashima.
|
|
14
|
+
|
|
15
|
+
### Thanks
|
|
16
|
+
|
|
17
|
+
* 1s22s1
|
|
18
|
+
* Taketo Takashima
|
|
19
|
+
|
|
3
20
|
## 0.3.1 - 2024-08-02
|
|
4
21
|
|
|
5
22
|
### Improvements
|
data/README.md
CHANGED
|
@@ -30,20 +30,16 @@ Or install it yourself as:
|
|
|
30
30
|
|
|
31
31
|
### Consuming RSS
|
|
32
32
|
|
|
33
|
-
If you'd like to read someone's RSS feed with your Ruby code, you've come to the right place. It's really easy to do this
|
|
33
|
+
If you'd like to read someone's RSS feed with your Ruby code, you've come to the right place. It's really easy to do this:
|
|
34
34
|
|
|
35
35
|
```ruby
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
feed.items.each do |item|
|
|
44
|
-
puts "Item: #{item.title}"
|
|
45
|
-
end
|
|
46
|
-
end
|
|
36
|
+
require 'rss'
|
|
37
|
+
|
|
38
|
+
feed = RSS::Parser.parse('https://www.ruby-lang.org/en/feeds/news.rss')
|
|
39
|
+
puts "Title: #{feed.channel.title}"
|
|
40
|
+
feed.items.each do |item|
|
|
41
|
+
puts "Item: #{item.title}"
|
|
42
|
+
end
|
|
47
43
|
```
|
|
48
44
|
|
|
49
45
|
As you can see, the workhorse is RSS::Parser#parse, which takes the source of the feed and a parameter that performs validation on the feed. We get back an object that has all of the data from our feed, accessible through methods. This example shows getting the title out of the channel element, and looping through the list of items.
|
data/lib/rss/rss.rb
CHANGED
data/lib/rss/version.rb
CHANGED
data/lib/rss/xml-stylesheet.rb
CHANGED
data/lib/rss/xml.rb
CHANGED
data/lib/rss.rb
CHANGED
|
@@ -19,19 +19,14 @@
|
|
|
19
19
|
# == Consuming RSS
|
|
20
20
|
#
|
|
21
21
|
# If you'd like to read someone's RSS feed with your Ruby code, you've come to
|
|
22
|
-
# the right place. It's really easy to do this
|
|
23
|
-
# open-uri:
|
|
22
|
+
# the right place. It's really easy to do this.
|
|
24
23
|
#
|
|
25
24
|
# require 'rss'
|
|
26
|
-
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
# puts "Title: #{feed.channel.title}"
|
|
32
|
-
# feed.items.each do |item|
|
|
33
|
-
# puts "Item: #{item.title}"
|
|
34
|
-
# end
|
|
25
|
+
#
|
|
26
|
+
# feed = RSS::Parser.parse('https://www.ruby-lang.org/en/feeds/news.rss')
|
|
27
|
+
# puts "Title: #{feed.channel.title}"
|
|
28
|
+
# feed.items.each do |item|
|
|
29
|
+
# puts "Item: #{item.title}"
|
|
35
30
|
# end
|
|
36
31
|
#
|
|
37
32
|
# As you can see, the workhorse is RSS::Parser#parse, which takes the source of
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rss
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kouhei Sutou
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rexml
|
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0'
|
|
97
97
|
requirements: []
|
|
98
|
-
rubygems_version:
|
|
98
|
+
rubygems_version: 4.0.2
|
|
99
99
|
specification_version: 4
|
|
100
100
|
summary: Family of libraries that support various formats of XML "feeds".
|
|
101
101
|
test_files: []
|