lomax 0.1.0 → 0.1.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 +4 -4
- data/bin/console +1 -1
- data/lib/lomax/command_line_interface.rb +4 -5
- data/lib/lomax/scraper.rb +3 -6
- data/lib/lomax/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5c2b275ee53a2bc299a82d2a3ba5fa6b4f474a36
|
|
4
|
+
data.tar.gz: 463b41afb3a8a3ff727610a4efca57cc5b52aa35
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bcf69844ce76782a0739e3aac2679138e62df450e0498e9e90973b1b35334b812b6c58ed1c25bbb48936ddc8ecbe7b0128c8df6936a1b8c4642856f25079a397
|
|
7
|
+
data.tar.gz: 4f90bb46a14b3cdfa727d106472719442e64175df89303fdabeaf215d479d1f30763c50be0962717076ab471c693b47c2ddcd800e288ba74d0a15850a19bbdd9
|
data/bin/console
CHANGED
|
@@ -12,7 +12,6 @@ class Lomax::CommandLineInterface
|
|
|
12
12
|
def display_recordings(place)
|
|
13
13
|
puts
|
|
14
14
|
puts
|
|
15
|
-
list_of_recordings = []
|
|
16
15
|
recordings = Lomax::Scraper.get_recordings(place)
|
|
17
16
|
recordings.each do |recording|
|
|
18
17
|
puts recording.title, recording.date
|
|
@@ -36,7 +35,7 @@ class Lomax::CommandLineInterface
|
|
|
36
35
|
return title
|
|
37
36
|
end
|
|
38
37
|
|
|
39
|
-
def
|
|
38
|
+
def place_validation
|
|
40
39
|
puts
|
|
41
40
|
display_places
|
|
42
41
|
city_answer = gets.chomp #it is a string
|
|
@@ -44,7 +43,7 @@ class Lomax::CommandLineInterface
|
|
|
44
43
|
choice = places_array.detect do |place|
|
|
45
44
|
place.name.downcase == city_answer.downcase
|
|
46
45
|
end
|
|
47
|
-
return choice
|
|
46
|
+
return choice #is a place object
|
|
48
47
|
end
|
|
49
48
|
|
|
50
49
|
|
|
@@ -61,9 +60,9 @@ class Lomax::CommandLineInterface
|
|
|
61
60
|
|
|
62
61
|
flag = nil
|
|
63
62
|
while flag == nil #these two lines basically say, "if everything remians as it now is..."
|
|
64
|
-
flag =
|
|
63
|
+
flag = place_validation
|
|
65
64
|
if flag != nil
|
|
66
|
-
recordings = display_recordings(flag)
|
|
65
|
+
recordings = display_recordings(flag) #array of recording objects
|
|
67
66
|
titles_array = recordings.collect do|recording|
|
|
68
67
|
recording.title
|
|
69
68
|
end
|
data/lib/lomax/scraper.rb
CHANGED
|
@@ -27,16 +27,13 @@ class Lomax::Scraper
|
|
|
27
27
|
|
|
28
28
|
def self.get_recordings(place)
|
|
29
29
|
doc = Nokogiri::HTML(open(place.url + "&c=150&st=list"))
|
|
30
|
-
recordings_array = []
|
|
31
30
|
doc.css(".search-results.list-view > li").each do |item|
|
|
32
31
|
title = item.css("div.description h2 a").text.strip
|
|
33
32
|
contributors = item.css("ul li.contributor span").text.strip
|
|
34
33
|
date = item.css("ul li.date span").text.strip
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return recordings_array
|
|
34
|
+
place.recordings << Lomax::Recording.new(title,contributors,date,place)
|
|
35
|
+
end
|
|
36
|
+
return place.recordings
|
|
40
37
|
end
|
|
41
38
|
|
|
42
39
|
|
data/lib/lomax/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lomax
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- nicolefederici
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-07-
|
|
11
|
+
date: 2016-07-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|