rss_feed_plus 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +11 -0
- data/CHANGELOG.md +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +82 -0
- data/Rakefile +6 -0
- data/lib/rss_feed/dynamic_object.rb +58 -0
- data/lib/rss_feed/feed/base.rb +41 -0
- data/lib/rss_feed/feed/channel.rb +47 -0
- data/lib/rss_feed/feed/item.rb +42 -0
- data/lib/rss_feed/feed/namespace.rb +75 -0
- data/lib/rss_feed/object.rb +47 -0
- data/lib/rss_feed/parser.rb +209 -0
- data/lib/rss_feed/version.rb +3 -0
- data/lib/rss_feed.rb +5 -0
- data/parser.rb +29 -0
- data/rbs_collection.lock.yaml +84 -0
- data/rbs_collection.yaml +19 -0
- data/rss_example/news.rss +1843 -0
- data/rss_example/prog.xml +84 -0
- data/rss_feed.gemspec +47 -0
- data/sig/dynamic_object.rbs +9 -0
- data/sig/rss_feed/feed/base.rbs +18 -0
- data/sig/rss_feed/feed/channel.rbs +15 -0
- data/sig/rss_feed/feed/item.rbs +15 -0
- data/sig/rss_feed/feed/namespace.rbs +21 -0
- data/sig/rss_feed/parser.rbs +51 -0
- data/sig/rss_feeds.rbs +4 -0
- metadata +83 -0
data/parser.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'rss_feed'
|
2
|
+
require 'nokogiri'
|
3
|
+
|
4
|
+
# require 'open-uri'
|
5
|
+
#
|
6
|
+
# # url = 'https://feeds.nbcnews.com/nbcnews/public/news'
|
7
|
+
# # url = 'https://abcnews.go.com/abcnews/usheadlines'
|
8
|
+
# url = 'https://feeds.nbcnews.com/nbcnews/public/news'
|
9
|
+
# url = 'https://www.ruby-lang.org/en/feeds/news.rss'
|
10
|
+
# rss = RssFeed::Parser.new(url).parse
|
11
|
+
# p rss
|
12
|
+
|
13
|
+
# Define your custom options
|
14
|
+
feed_urls = 'https://feeds.nbcnews.com/nbcnews/public/news'
|
15
|
+
xml_parser = Nokogiri
|
16
|
+
uri_parser = URI
|
17
|
+
timeout = 10
|
18
|
+
|
19
|
+
# Initialize the Parser class with custom options
|
20
|
+
parser = RssFeed::Parser.new(feed_urls, xml_parser: xml_parser, uri_parser: uri_parser, timeout: timeout)
|
21
|
+
|
22
|
+
# Parse the RSS feeds
|
23
|
+
# parsed_data = parser.parse
|
24
|
+
|
25
|
+
# Process the parsed data
|
26
|
+
# puts parsed_data.inspect
|
27
|
+
|
28
|
+
parsed_data = parser.parse_as_object
|
29
|
+
puts parsed_data.inspect
|
@@ -0,0 +1,84 @@
|
|
1
|
+
---
|
2
|
+
path: ".gem_rbs_collection"
|
3
|
+
gems:
|
4
|
+
- name: ast
|
5
|
+
version: '2.4'
|
6
|
+
source:
|
7
|
+
type: git
|
8
|
+
name: ruby/gem_rbs_collection
|
9
|
+
revision: 372c833bb52be1bc34aef5e2793ab47c35c0dba9
|
10
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
11
|
+
repo_dir: gems
|
12
|
+
- name: fileutils
|
13
|
+
version: '0'
|
14
|
+
source:
|
15
|
+
type: stdlib
|
16
|
+
- name: json
|
17
|
+
version: '0'
|
18
|
+
source:
|
19
|
+
type: stdlib
|
20
|
+
- name: nokogiri
|
21
|
+
version: '1.11'
|
22
|
+
source:
|
23
|
+
type: git
|
24
|
+
name: ruby/gem_rbs_collection
|
25
|
+
revision: 372c833bb52be1bc34aef5e2793ab47c35c0dba9
|
26
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
27
|
+
repo_dir: gems
|
28
|
+
- name: parallel
|
29
|
+
version: '1.20'
|
30
|
+
source:
|
31
|
+
type: git
|
32
|
+
name: ruby/gem_rbs_collection
|
33
|
+
revision: 372c833bb52be1bc34aef5e2793ab47c35c0dba9
|
34
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
35
|
+
repo_dir: gems
|
36
|
+
- name: parser
|
37
|
+
version: '3.2'
|
38
|
+
source:
|
39
|
+
type: git
|
40
|
+
name: ruby/gem_rbs_collection
|
41
|
+
revision: 372c833bb52be1bc34aef5e2793ab47c35c0dba9
|
42
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
43
|
+
repo_dir: gems
|
44
|
+
- name: rainbow
|
45
|
+
version: '3.0'
|
46
|
+
source:
|
47
|
+
type: git
|
48
|
+
name: ruby/gem_rbs_collection
|
49
|
+
revision: 372c833bb52be1bc34aef5e2793ab47c35c0dba9
|
50
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
51
|
+
repo_dir: gems
|
52
|
+
- name: rake
|
53
|
+
version: '13.0'
|
54
|
+
source:
|
55
|
+
type: git
|
56
|
+
name: ruby/gem_rbs_collection
|
57
|
+
revision: 372c833bb52be1bc34aef5e2793ab47c35c0dba9
|
58
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
59
|
+
repo_dir: gems
|
60
|
+
- name: regexp_parser
|
61
|
+
version: '2.8'
|
62
|
+
source:
|
63
|
+
type: git
|
64
|
+
name: ruby/gem_rbs_collection
|
65
|
+
revision: 372c833bb52be1bc34aef5e2793ab47c35c0dba9
|
66
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
67
|
+
repo_dir: gems
|
68
|
+
- name: rubocop
|
69
|
+
version: '1.57'
|
70
|
+
source:
|
71
|
+
type: git
|
72
|
+
name: ruby/gem_rbs_collection
|
73
|
+
revision: 372c833bb52be1bc34aef5e2793ab47c35c0dba9
|
74
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
75
|
+
repo_dir: gems
|
76
|
+
- name: rubocop-ast
|
77
|
+
version: '1.30'
|
78
|
+
source:
|
79
|
+
type: git
|
80
|
+
name: ruby/gem_rbs_collection
|
81
|
+
revision: 372c833bb52be1bc34aef5e2793ab47c35c0dba9
|
82
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
83
|
+
repo_dir: gems
|
84
|
+
gemfile_lock_path: Gemfile.lock
|
data/rbs_collection.yaml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# Download sources
|
2
|
+
sources:
|
3
|
+
- type: git
|
4
|
+
name: ruby/gem_rbs_collection
|
5
|
+
remote: https://github.com/ruby/gem_rbs_collection.git
|
6
|
+
revision: main
|
7
|
+
repo_dir: gems
|
8
|
+
|
9
|
+
# You can specify local directories as sources also.
|
10
|
+
# - type: local
|
11
|
+
# path: path/to/your/local/repository
|
12
|
+
|
13
|
+
# A directory to install the downloaded RBSs
|
14
|
+
path: .gem_rbs_collection
|
15
|
+
|
16
|
+
# gems:
|
17
|
+
# # If you want to avoid installing rbs files for gems, you can specify them here.
|
18
|
+
# - name: GEM_NAME
|
19
|
+
# ignore: true
|