bbc10 1.0.3 ā 1.0.4
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/bin/bbc10 +16 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d56b760c6461e1e5ec30cbc38e816bba6ab01ae33d29cc5d219572d8644ba327
|
4
|
+
data.tar.gz: d9f02c6e7103c593f31548381dd70edbac5548bb73c1a8522848b74e5fdef053
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68e1359719b9b1ba3bbccb269ab227edc98ef31e2ffe17251ad08f4ac1bb3f0a75957f531ddd4acc7288129d900bc04c84929744646eb6615407f33a109d7618
|
7
|
+
data.tar.gz: f555cdf5b6d9a533e30ea3e78c6c916371b08ec1d5256d9d863c677e5e140a3cd203154a97fcdf0bcf9ce08f0943a850f303866299cc19f3a873a6fbdbde14e3
|
data/bin/bbc10
CHANGED
@@ -3,17 +3,25 @@ require_relative '../lib/bbc10/scraper'
|
|
3
3
|
|
4
4
|
module Bbc10
|
5
5
|
URL = 'https://www.bbc.co.uk/news'
|
6
|
-
puts "\n\
|
6
|
+
puts "\n\nš Scraping the most read from #{URL}..."
|
7
7
|
begin
|
8
|
-
|
9
|
-
links =
|
10
|
-
links.
|
11
|
-
puts "\n\n
|
12
|
-
|
13
|
-
|
8
|
+
page = Scraper::read_page(URL)
|
9
|
+
links = Scraper::get_links(page)
|
10
|
+
if links.empty?
|
11
|
+
puts "\n\nā Failed to find top ten"
|
12
|
+
raise exception
|
13
|
+
else
|
14
|
+
puts "\nš #{links.length} articles found"
|
15
|
+
links.each do | link |
|
16
|
+
puts "\n\nš° #{link}\n\n"
|
17
|
+
story = Scraper::read_page(link)
|
18
|
+
Scraper::scrape_story(story)
|
19
|
+
end
|
20
|
+
puts "ā„ļø s33dco\n\n"
|
14
21
|
end
|
22
|
+
|
15
23
|
rescue => exception
|
16
|
-
puts "\n\nā
|
24
|
+
puts "\n\nā somethings not right."
|
17
25
|
puts "Maybe check they're available on the link below :"
|
18
26
|
puts "\n#{URL}\n\n"
|
19
27
|
end
|