simple-rss 1.3.3 → 2.1.0
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/LICENSE +79 -7
- data/README.md +321 -0
- data/Rakefile +134 -136
- data/lib/simple-rss.rb +541 -154
- data/simple-rss.gemspec +5 -6
- data/test/base/array_tags_test.rb +37 -0
- data/test/base/base_test.rb +76 -77
- data/test/base/empty_tag_test.rb +56 -0
- data/test/base/encoding_test.rb +87 -0
- data/test/base/enumerable_test.rb +101 -0
- data/test/base/feed_attributes_test.rb +26 -0
- data/test/base/fetch_test.rb +117 -0
- data/test/base/hash_xml_serialization_test.rb +142 -0
- data/test/base/item_attributes_test.rb +26 -0
- data/test/base/json_serialization_test.rb +81 -0
- data/test/data/atom_with_entry_attrs.xml +13 -0
- data/test/data/atom_with_feed_attrs.xml +13 -0
- data/test/data/media_rss.xml +465 -0
- data/test/data/rss20_utf8.xml +61 -0
- data/test/data/rss20_with_channel_attrs.xml +13 -0
- data/test/data/rss20_with_item_attrs.xml +13 -0
- data/test/test_helper.rb +10 -3
- metadata +21 -11
- data/README.markdown +0 -47
- data/install.rb +0 -40
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simple-rss
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lucas Carlson
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 2025-12-29 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rake
|
|
@@ -61,21 +60,34 @@ extensions: []
|
|
|
61
60
|
extra_rdoc_files: []
|
|
62
61
|
files:
|
|
63
62
|
- LICENSE
|
|
64
|
-
- README.
|
|
63
|
+
- README.md
|
|
65
64
|
- Rakefile
|
|
66
|
-
- install.rb
|
|
67
65
|
- lib/simple-rss.rb
|
|
68
66
|
- simple-rss.gemspec
|
|
67
|
+
- test/base/array_tags_test.rb
|
|
69
68
|
- test/base/base_test.rb
|
|
69
|
+
- test/base/empty_tag_test.rb
|
|
70
|
+
- test/base/encoding_test.rb
|
|
71
|
+
- test/base/enumerable_test.rb
|
|
72
|
+
- test/base/feed_attributes_test.rb
|
|
73
|
+
- test/base/fetch_test.rb
|
|
74
|
+
- test/base/hash_xml_serialization_test.rb
|
|
75
|
+
- test/base/item_attributes_test.rb
|
|
76
|
+
- test/base/json_serialization_test.rb
|
|
70
77
|
- test/data/atom.xml
|
|
78
|
+
- test/data/atom_with_entry_attrs.xml
|
|
79
|
+
- test/data/atom_with_feed_attrs.xml
|
|
80
|
+
- test/data/media_rss.xml
|
|
71
81
|
- test/data/not-rss.xml
|
|
72
82
|
- test/data/rss09.rdf
|
|
73
83
|
- test/data/rss20.xml
|
|
84
|
+
- test/data/rss20_utf8.xml
|
|
85
|
+
- test/data/rss20_with_channel_attrs.xml
|
|
86
|
+
- test/data/rss20_with_item_attrs.xml
|
|
74
87
|
- test/test_helper.rb
|
|
75
|
-
homepage:
|
|
88
|
+
homepage: https://github.com/cardmagic/simple-rss
|
|
76
89
|
licenses: []
|
|
77
90
|
metadata: {}
|
|
78
|
-
post_install_message:
|
|
79
91
|
rdoc_options: []
|
|
80
92
|
require_paths:
|
|
81
93
|
- lib
|
|
@@ -83,16 +95,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
83
95
|
requirements:
|
|
84
96
|
- - ">="
|
|
85
97
|
- !ruby/object:Gem::Version
|
|
86
|
-
version: '
|
|
98
|
+
version: '3.1'
|
|
87
99
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
100
|
requirements:
|
|
89
101
|
- - ">="
|
|
90
102
|
- !ruby/object:Gem::Version
|
|
91
103
|
version: '0'
|
|
92
104
|
requirements: []
|
|
93
|
-
|
|
94
|
-
rubygems_version: 2.7.6
|
|
95
|
-
signing_key:
|
|
105
|
+
rubygems_version: 4.0.3
|
|
96
106
|
specification_version: 4
|
|
97
107
|
summary: A simple, flexible, extensible, and liberal RSS and Atom reader for Ruby.
|
|
98
108
|
It is designed to be backwards compatible with the standard RSS parser, but will
|
data/README.markdown
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
## Welcome to Simple RSS
|
|
2
|
-
|
|
3
|
-
Simple RSS is a simple, flexible, extensible, and liberal RSS and Atom reader
|
|
4
|
-
for Ruby. It is designed to be backwards compatible with the standard RSS
|
|
5
|
-
parser, but will never do RSS generation.
|
|
6
|
-
|
|
7
|
-
## Download
|
|
8
|
-
|
|
9
|
-
* gem install simple-rss
|
|
10
|
-
* https://github.com/cardmagic/simple-rss
|
|
11
|
-
* git clone git@github.com:cardmagic/simple-rss.git
|
|
12
|
-
|
|
13
|
-
### Usage
|
|
14
|
-
The API is similar to Ruby's standard RSS parser:
|
|
15
|
-
|
|
16
|
-
require 'rubygems'
|
|
17
|
-
require 'simple-rss'
|
|
18
|
-
require 'open-uri'
|
|
19
|
-
|
|
20
|
-
rss = SimpleRSS.parse open('http://slashdot.org/index.rdf')
|
|
21
|
-
|
|
22
|
-
rss.channel.title # => "Slashdot"
|
|
23
|
-
rss.channel.link # => "http://slashdot.org/"
|
|
24
|
-
rss.items.first.link # => "http://books.slashdot.org/article.pl?sid=05/08/29/1319236&from=rss"
|
|
25
|
-
|
|
26
|
-
But since the parser can read Atom feeds as easily as RSS feeds, there are optional aliases that allow more atom like reading:
|
|
27
|
-
|
|
28
|
-
rss.feed.title # => "Slashdot"
|
|
29
|
-
rss.feed.link # => "http://slashdot.org/"
|
|
30
|
-
rss.entries.first.link # => "http://books.slashdot.org/article.pl?sid=05/08/29/1319236&from=rss"
|
|
31
|
-
|
|
32
|
-
The parser does not care about the correctness of the XML as it does not use an XML library to read the information. Thus it is flexible and allows for easy extending via:
|
|
33
|
-
|
|
34
|
-
SimpleRSS.feed_tags << :some_new_tag
|
|
35
|
-
SimpleRSS.item_tags << :"item+myrel" # this will extend SimpleRSS to be able to parse RSS items or ATOM entries that have a rel specified, common in many blogger feeds
|
|
36
|
-
SimpleRSS.item_tags << :"feedburner:origLink" # this will extend SimpleRSS to be able to parse RSS items or ATOM entries that have a specific pre-tag specified, common in many feedburner feeds
|
|
37
|
-
SimpleRSS.item_tags << :"media:content#url" # this will grab the url attribute of the media:content tag
|
|
38
|
-
|
|
39
|
-
## Authors
|
|
40
|
-
|
|
41
|
-
* Lucas Carlson (mailto:lucas@rufy.com)
|
|
42
|
-
* Herval Freire (mailto:hervalfreire@gmail.com)
|
|
43
|
-
|
|
44
|
-
Inspired by [Blagg](http://www.raelity.org/lang/perl/blagg) from Rael Dornfest.
|
|
45
|
-
|
|
46
|
-
This library is released under the terms of the GNU LGPL.
|
|
47
|
-
|
data/install.rb
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
require 'rbconfig'
|
|
2
|
-
require 'find'
|
|
3
|
-
require 'ftools'
|
|
4
|
-
|
|
5
|
-
include Config
|
|
6
|
-
|
|
7
|
-
# this was adapted from rdoc's install.rb by ways of Log4r
|
|
8
|
-
|
|
9
|
-
$sitedir = CONFIG["sitelibdir"]
|
|
10
|
-
unless $sitedir
|
|
11
|
-
version = CONFIG["MAJOR"] + "." + CONFIG["MINOR"]
|
|
12
|
-
$libdir = File.join(CONFIG["libdir"], "ruby", version)
|
|
13
|
-
$sitedir = $:.find {|x| x =~ /site_ruby/ }
|
|
14
|
-
if !$sitedir
|
|
15
|
-
$sitedir = File.join($libdir, "site_ruby")
|
|
16
|
-
elsif $sitedir !~ Regexp.quote(version)
|
|
17
|
-
$sitedir = File.join($sitedir, version)
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
makedirs = %w{ shipping }
|
|
22
|
-
makedirs.each {|f| File::makedirs(File.join($sitedir, *f.split(/\//)))}
|
|
23
|
-
|
|
24
|
-
Dir.chdir("lib")
|
|
25
|
-
begin
|
|
26
|
-
require 'rubygems'
|
|
27
|
-
require 'rake'
|
|
28
|
-
rescue LoadError
|
|
29
|
-
puts
|
|
30
|
-
puts "Please install Gem and Rake from http://rubyforge.org/projects/rubygems and http://rubyforge.org/projects/rake"
|
|
31
|
-
puts
|
|
32
|
-
exit(-1)
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
files = FileList["**/*"]
|
|
36
|
-
|
|
37
|
-
# File::safe_unlink *deprecated.collect{|f| File.join($sitedir, f.split(/\//))}
|
|
38
|
-
files.each {|f|
|
|
39
|
-
File::install(f, File.join($sitedir, *f.split(/\//)), 0644, true)
|
|
40
|
-
}
|