rss_gem 1.0.1
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 +7 -0
- data/lib/rss_gem.rb +23 -0
- metadata +43 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 60fe4f02ffdbde68c12c23287ff3fb6340eed71c9cc51eec27eea653798a8be5
|
4
|
+
data.tar.gz: 9982996415000a6f26606feed22b25b30f289d47ae19fad3825eb593e86dba3d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7e66553e9a562ed9c257db615d0cb4b751a016099885a6a15ae59d6f450eb61c6fe98dd4787d7306ec522c99dc23d54eee98c73d897b984505bf604087dcc915
|
7
|
+
data.tar.gz: d62023a762a3fb6597b5720a674b45a38cf0fe61ff33b115493bf09c15ce30324a1e44d70cda7cc6ab14130b38b9db246018c270851d0cb6467cc4b918b10296
|
data/lib/rss_gem.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
class Rss
|
2
|
+
def self.runcheck(feed_link,source_name)
|
3
|
+
#Imports
|
4
|
+
require "rss"
|
5
|
+
require "open-uri"
|
6
|
+
|
7
|
+
#Establish array for news list
|
8
|
+
rss_list = []
|
9
|
+
|
10
|
+
#Gets the RSS link passed in through the controller via the "feed_link" and parses the RSS data
|
11
|
+
rss = RSS::Parser.parse(open(feed_link).read, false).items
|
12
|
+
|
13
|
+
#For each item in the RSS data it saves the title, page link, publish data of that item into an object, it gets the source name from the controller via the "source_name"
|
14
|
+
#Each object is then added the the rss_list array of objects.
|
15
|
+
#Once it has gones through each item in the feed, it will return the array
|
16
|
+
rss.each do |item|
|
17
|
+
item = {title: item.title, link: item.link, pubdate: item.pubDate, source: source_name}
|
18
|
+
rss_list.push(item)
|
19
|
+
|
20
|
+
end
|
21
|
+
return rss_list
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rss_gem
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Patrick Brennan
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-07-12 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email:
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/rss_gem.rb
|
20
|
+
homepage:
|
21
|
+
licenses: []
|
22
|
+
metadata: {}
|
23
|
+
post_install_message:
|
24
|
+
rdoc_options: []
|
25
|
+
require_paths:
|
26
|
+
- lib
|
27
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
28
|
+
requirements:
|
29
|
+
- - ">="
|
30
|
+
- !ruby/object:Gem::Version
|
31
|
+
version: '0'
|
32
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '0'
|
37
|
+
requirements: []
|
38
|
+
rubyforge_project:
|
39
|
+
rubygems_version: 2.7.6
|
40
|
+
signing_key:
|
41
|
+
specification_version: 4
|
42
|
+
summary: Pulls Data from any RSS feed and saves the data into an array of objects
|
43
|
+
test_files: []
|