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
@@ -0,0 +1,84 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<feed xmlns="http://www.w3.org/2005/Atom">
|
3
|
+
<title>FYI Center for Software Developers</title>
|
4
|
+
<subtitle>FYI (For Your Information) Center for Software Developers with
|
5
|
+
large collection of FAQs, tutorials and tips codes for application and
|
6
|
+
wWeb developers on Java, .NET, C, PHP, JavaScript, XML, HTML, CSS, RSS,
|
7
|
+
MySQL and Oracle - dev.fyicenter.com.</subtitle>
|
8
|
+
<link rel="self" href="http://dev.fyicenter.com/atom_xml.php"/>
|
9
|
+
<id>http://dev.fyicenter.com/atom_xml.php</id>
|
10
|
+
<updated>2017-09-22T03:58:52+02:00</updated>
|
11
|
+
<author>
|
12
|
+
<name>FYIcenter.com</name>
|
13
|
+
</author>
|
14
|
+
<rights>Copyright (c) 2017 FYIcenter.com</rights>
|
15
|
+
<category term="Programming"/>
|
16
|
+
<category term="Computer"/>
|
17
|
+
<category term="Developer"/>
|
18
|
+
<entry>
|
19
|
+
<title>Use Developer Portal Internally</title>
|
20
|
+
<link rel="alternate"
|
21
|
+
href="http://dev.fyicenter.com/1000702_Use_Developer_Portal_Internally.ht
|
22
|
+
ml"/>
|
23
|
+
|
24
|
+
<id>http://dev.fyicenter.com/1000702_Use_Developer_Portal_Internally.html
|
25
|
+
</id>
|
26
|
+
<updated>2017-09-20T13:29:08+02:00</updated>
|
27
|
+
<summary type="html"><img align='left' width='64' height='64'
|
28
|
+
src='http://dev.fyicenter.com/Azure-API/_icon_Azure-API.png' />How to
|
29
|
+
use the Developer Portal internally by you as the publisher? Normally,
|
30
|
+
the Developer Portal of an Azure API Management Service is used by
|
31
|
+
client developers. But as a publisher, you can also use the Developer
|
32
|
+
Portal to test API operations internally. You can follow this tutorial
|
33
|
+
to access the ... - Rank: 120; Updated: 2017-09-20 13:29:06 -> <a
|
34
|
+
href='http://dev.fyicenter.com/1000702_Use_Developer_Portal_Internally.ht
|
35
|
+
ml'>Source</a></summary>
|
36
|
+
<author>
|
37
|
+
<name>FYIcenter.com</name>
|
38
|
+
</author>
|
39
|
+
<category term="Microsoft"/>
|
40
|
+
</entry>
|
41
|
+
<entry>
|
42
|
+
<title>Using Azure API Management Developer Portal</title>
|
43
|
+
<link rel="alternate"
|
44
|
+
href="http://dev.fyicenter.com/1000701_Using_Azure_API_Management_Develop
|
45
|
+
er_Portal.html"/>
|
46
|
+
|
47
|
+
<id>http://dev.fyicenter.com/1000701_Using_Azure_API_Management_Developer
|
48
|
+
_Portal.html</id>
|
49
|
+
<updated>2017-09-20T13:29:07+02:00</updated>
|
50
|
+
<summary type="html"><img align='left' width='64' height='64'
|
51
|
+
src='http://dev.fyicenter.com/Azure-API/_icon_Azure-API.png' />Where to
|
52
|
+
find tutorials on Using Azure API Management Developer Portal? Here is
|
53
|
+
a list of tutorials to answer many frequently asked questions compiled
|
54
|
+
by FYIcenter.com team on Using Azure API Management Developer Portal:
|
55
|
+
Use Developer Portal Internally What Can I See on Developer Portal What
|
56
|
+
I You T... - Rank: 120; Updated: 2017-09-20 13:29:06 -> <a
|
57
|
+
href='http://dev.fyicenter.com/1000701_Using_Azure_API_Management_Develop
|
58
|
+
er_Portal.html'>Source</a></summary>
|
59
|
+
<author>
|
60
|
+
<name>FYIcenter.com</name>
|
61
|
+
</author>
|
62
|
+
<category term="Microsoft"/>
|
63
|
+
</entry>
|
64
|
+
<entry>
|
65
|
+
<title>Add API to API Products</title>
|
66
|
+
<link rel="alternate"
|
67
|
+
href="http://dev.fyicenter.com/1000700_Add_API_to_API_Products.html"/>
|
68
|
+
<id>http://dev.fyicenter.com/1000700_Add_API_to_API_Products.html</id>
|
69
|
+
<updated>2017-09-20T13:29:06+02:00</updated>
|
70
|
+
<summary type="html"><img align='left' width='64' height='64'
|
71
|
+
src='http://dev.fyicenter.com/Azure-API/_icon_Azure-API.png' />How to
|
72
|
+
add an API to an API product for internal testing on the Publisher
|
73
|
+
Portal of an Azure API Management Service? You can follow this tutorial
|
74
|
+
to add an API to an API product on the Publisher Portal of an Azure API
|
75
|
+
Management Service. 1. Click API from the left menu on the Publisher
|
76
|
+
Portal. You s... - Rank: 119; Updated: 2017-09-20 13:29:06 -> <a
|
77
|
+
href='http://dev.fyicenter.com/1000700_Add_API_to_API_Products.html'>Sour
|
78
|
+
ce</a></summary>
|
79
|
+
<author>
|
80
|
+
<name>FYIcenter.com</name>
|
81
|
+
</author>
|
82
|
+
<category term="Microsoft"/>
|
83
|
+
</entry>
|
84
|
+
</feed>
|
data/rss_feed.gemspec
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require_relative 'lib/rss_feed/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'rss_feed_plus'
|
5
|
+
spec.version = RssFeed::VERSION
|
6
|
+
spec.authors = ['talaatmagdyx']
|
7
|
+
spec.email = ['talaatmagdy75@gmail.com']
|
8
|
+
|
9
|
+
spec.summary = 'A simple RSS parser gem for Ruby'
|
10
|
+
spec.description = <<-DESC
|
11
|
+
#{spec.name} is a Ruby gem designed to simplify the process of parsing RSS feed in Ruby applications.#{' '}
|
12
|
+
It provides a straightforward interface for fetching RSS feed from URLs and extracting relevant information#{' '}
|
13
|
+
such as titles, links, descriptions, publication dates, and authors.#{' '}
|
14
|
+
With #{spec.name}, you can quickly integrate RSS feed parsing functionality into your Ruby projects,#{' '}
|
15
|
+
making it easy to work with syndicated content from various sources.
|
16
|
+
DESC
|
17
|
+
spec.homepage = 'https://github.com/talaatmagdyx/rss_feed_plus'
|
18
|
+
spec.license = 'MIT'
|
19
|
+
spec.required_ruby_version = '>= 2.6.0'
|
20
|
+
|
21
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
22
|
+
spec.metadata['source_code_uri'] = 'https://github.com/talaatmagdyx/rss_feed_plus'
|
23
|
+
spec.metadata['changelog_uri'] = 'https://github.com/talaatmagdyx/rss_feed_plus/blob/main/CHANGELOG.md'
|
24
|
+
spec.metadata['bug_tracker_uri'] = 'https://github.com/talaatmagdyx/rss_feed_plus/issues'
|
25
|
+
spec.metadata['wiki_uri'] = 'https://github.com/talaatmagdyx/rss_feed_plus/wiki'
|
26
|
+
spec.post_install_message = "Thanks for installing! #{spec.name} is a simple RSS parser gem for Ruby."
|
27
|
+
spec.platform = Gem::Platform::RUBY
|
28
|
+
|
29
|
+
# Specify which files should be added to the gem when it is released.
|
30
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
31
|
+
spec.files = Dir.chdir(__dir__) do
|
32
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
33
|
+
(File.expand_path(f) == __FILE__) ||
|
34
|
+
f.start_with?(*%w[bin/ test/ spec/ features/ .git appveyor Gemfile])
|
35
|
+
end
|
36
|
+
end
|
37
|
+
spec.bindir = 'exe'
|
38
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
39
|
+
spec.require_paths = ['lib']
|
40
|
+
|
41
|
+
# Uncomment to register a new dependency of your gem
|
42
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
43
|
+
|
44
|
+
# For more information and examples about making a new gem, check out our
|
45
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
46
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
47
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module RssFeed
|
2
|
+
module Feed
|
3
|
+
class Base
|
4
|
+
@document: Nokogiri::XML::Document
|
5
|
+
|
6
|
+
attr_reader document: Nokogiri::XML::Document
|
7
|
+
|
8
|
+
def parser: -> Nokogiri::XML::Document
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def detect_feed_type: -> String
|
13
|
+
|
14
|
+
|
15
|
+
def execute_method: -> String
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module RssFeed
|
2
|
+
module Feed
|
3
|
+
class Namespace
|
4
|
+
NAMESPACES: Hash[String, String]
|
5
|
+
|
6
|
+
def self.access_tag: (tag: String, doc: Nokogiri::XML::NodeSet)-> Hash[Symbol, bool | String | Nokogiri::XML::Document ]
|
7
|
+
|
8
|
+
def self.namespace: (tag: String)-> Hash[String, String]
|
9
|
+
|
10
|
+
def self.nested_attributes?: (node: Nokogiri::XML::NodeSet) -> bool
|
11
|
+
|
12
|
+
def self.nested_elements?: (node: Nokogiri::XML::NodeSet) -> bool
|
13
|
+
|
14
|
+
def self.remove_html_tags: (content: Nokogiri::XML::NodeSet)-> String
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def self.contains_html_tags?: (content: String)-> bool
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module RssFeed
|
2
|
+
class Parser
|
3
|
+
@feed_urls: Array[String]
|
4
|
+
|
5
|
+
@logger: Logger
|
6
|
+
|
7
|
+
attr_reader feed_urls: String
|
8
|
+
attr_reader uri_parser: untyped
|
9
|
+
attr_reader xml_parser: Nokogiri | untyped
|
10
|
+
|
11
|
+
def initialize: (feed_urls: String) -> void
|
12
|
+
|
13
|
+
def parse: -> Hash[String, Hash[Symbol, Hash[Symbol, String]] | Array[Hash[Symbol, Hash[Symbol, String]]]]
|
14
|
+
|
15
|
+
def parse_as_object: -> DynamicObject
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def add_attributes: -> void
|
20
|
+
|
21
|
+
def configure_logger: -> void
|
22
|
+
|
23
|
+
def create_item_info: -> Hash[String, untyped]
|
24
|
+
|
25
|
+
def extract_attributes: (node: Nokogiri::XML::NodeSet)-> Array[Hash[Symbol, Hash[Symbol, String]]]
|
26
|
+
|
27
|
+
def extract_channel_info: (channel: Feed::Channel)-> Hash[Symbol, Hash[Symbol, String]]
|
28
|
+
|
29
|
+
def extract_clean_value: (docs: Nokogiri::XML::Document)-> String
|
30
|
+
|
31
|
+
def extract_info: (feed: Feed::Item | Feed::Channel)-> Hash[Symbol, Hash[Symbol, String]]
|
32
|
+
|
33
|
+
def extract_item_info: (items: Feed::Item)-> Array[Hash[Symbol, Hash[Symbol, String]]]
|
34
|
+
|
35
|
+
def extract_items: (tag_data: Hash[Symbol, String])-> (Hash[Symbol, Hash[Symbol, String]] | String)
|
36
|
+
|
37
|
+
def extract_nested_data: (nodes: Nokogiri::XML::NodeSet)-> Hash[Symbol, Hash[Symbol, String]]
|
38
|
+
|
39
|
+
def extract_tag_data: (tag: String, feed_parse: Nokogiri::XML::Document)-> Hash[Symbol, String | bool| Nokogiri::XML::Document]
|
40
|
+
|
41
|
+
def fetch_and_parse_xml: -> Nokogiri::XML::Document
|
42
|
+
|
43
|
+
def handle_error: (error: string)-> void
|
44
|
+
|
45
|
+
def skip_extraction?: -> bool
|
46
|
+
|
47
|
+
def skip_items?: -> bool
|
48
|
+
|
49
|
+
def uri_options: -> Hash[Symbol | String, String | Integer]
|
50
|
+
end
|
51
|
+
end
|
data/sig/rss_feeds.rbs
ADDED
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rss_feed_plus
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- talaatmagdyx
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-04-08 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: " rss_feed_plus is a Ruby gem designed to simplify the process of
|
14
|
+
parsing RSS feed in Ruby applications. \n It provides a straightforward interface
|
15
|
+
for fetching RSS feed from URLs and extracting relevant information \n such as
|
16
|
+
titles, links, descriptions, publication dates, and authors. \n With rss_feed_plus,
|
17
|
+
you can quickly integrate RSS feed parsing functionality into your Ruby projects,
|
18
|
+
\n making it easy to work with syndicated content from various sources.\n"
|
19
|
+
email:
|
20
|
+
- talaatmagdy75@gmail.com
|
21
|
+
executables: []
|
22
|
+
extensions: []
|
23
|
+
extra_rdoc_files: []
|
24
|
+
files:
|
25
|
+
- ".rspec"
|
26
|
+
- ".rubocop.yml"
|
27
|
+
- CHANGELOG.md
|
28
|
+
- LICENSE.txt
|
29
|
+
- README.md
|
30
|
+
- Rakefile
|
31
|
+
- lib/rss_feed.rb
|
32
|
+
- lib/rss_feed/dynamic_object.rb
|
33
|
+
- lib/rss_feed/feed/base.rb
|
34
|
+
- lib/rss_feed/feed/channel.rb
|
35
|
+
- lib/rss_feed/feed/item.rb
|
36
|
+
- lib/rss_feed/feed/namespace.rb
|
37
|
+
- lib/rss_feed/object.rb
|
38
|
+
- lib/rss_feed/parser.rb
|
39
|
+
- lib/rss_feed/version.rb
|
40
|
+
- parser.rb
|
41
|
+
- rbs_collection.lock.yaml
|
42
|
+
- rbs_collection.yaml
|
43
|
+
- rss_example/news.rss
|
44
|
+
- rss_example/prog.xml
|
45
|
+
- rss_feed.gemspec
|
46
|
+
- sig/dynamic_object.rbs
|
47
|
+
- sig/rss_feed/feed/base.rbs
|
48
|
+
- sig/rss_feed/feed/channel.rbs
|
49
|
+
- sig/rss_feed/feed/item.rbs
|
50
|
+
- sig/rss_feed/feed/namespace.rbs
|
51
|
+
- sig/rss_feed/parser.rbs
|
52
|
+
- sig/rss_feeds.rbs
|
53
|
+
homepage: https://github.com/talaatmagdyx/rss_feed_plus
|
54
|
+
licenses:
|
55
|
+
- MIT
|
56
|
+
metadata:
|
57
|
+
homepage_uri: https://github.com/talaatmagdyx/rss_feed_plus
|
58
|
+
source_code_uri: https://github.com/talaatmagdyx/rss_feed_plus
|
59
|
+
changelog_uri: https://github.com/talaatmagdyx/rss_feed_plus/blob/main/CHANGELOG.md
|
60
|
+
bug_tracker_uri: https://github.com/talaatmagdyx/rss_feed_plus/issues
|
61
|
+
wiki_uri: https://github.com/talaatmagdyx/rss_feed_plus/wiki
|
62
|
+
rubygems_mfa_required: 'true'
|
63
|
+
post_install_message: Thanks for installing! rss_feed_plus is a simple RSS parser
|
64
|
+
gem for Ruby.
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 2.6.0
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
requirements: []
|
79
|
+
rubygems_version: 3.0.3.1
|
80
|
+
signing_key:
|
81
|
+
specification_version: 4
|
82
|
+
summary: A simple RSS parser gem for Ruby
|
83
|
+
test_files: []
|