-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.rb
41 lines (32 loc) · 886 Bytes
/
app.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#Relative Imports to bring in other loca RB files.
require_relative "rssData.rb"
require_relative "rssManager.rb"
$stdout.flush
class Application
def Execute
$stdout.puts "Hello, please enter your url below: "
$stdout.flush
rssUrl = gets.chomp
rssManager = RSS_func.new
rssChannel = rssManager.loadRssChannelFromUrl(rssUrl)
# channel info
puts "channel title"
puts rssChannel.Title
puts "channel description"
puts rssChannel.Description
puts "channel link"
puts rssChannel.Link
# Items info
for index in 0..rssChannel.RssItems.length - 1
puts "Title"
puts rssChannel.RssItems[index].Title
puts "description"
puts rssChannel.RssItems[index].Description
puts "link"
puts rssChannel.RssItems[index].Link
end
end
end
# application
application = Application.new
application.Execute