se_climbing_videos 0.1.4 → 0.1.5
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/lib/se_climbing_videos.rb +14 -29
- data/lib/se_climbing_videos/cli.rb +30 -3
- data/lib/se_climbing_videos/version.rb +1 -1
- data/se_climbing_videos.gemspec +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b71d4aa93294605cd75c30c86eca10cbb9a46c8c
|
4
|
+
data.tar.gz: ccffc335b9147f176ebdb7738b292d3df6c8a5f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 593ec5320420cdc547583cfd64dc99bb95ffb53c35f658ef60ab6275bed5cd9226824e6c86365bfe4b24cac01505e933752f87a721cbcf959ef4d7b87a39d8ad
|
7
|
+
data.tar.gz: 1172ee6a58f7cbf1401f2f9e42628e9dff8ccd9394f7612682e9f1cdbaf2a6d846f2d7edc593392db56bd454eedf4fce670238d006645a77eff4cc83b9d9a00e
|
data/lib/se_climbing_videos.rb
CHANGED
@@ -1,30 +1,15 @@
|
|
1
|
-
require_relative '../config/environment'
|
1
|
+
#require_relative '../config/environment'
|
2
2
|
|
3
|
-
module SeClimbingVideos
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
},
|
17
|
-
"4" => {
|
18
|
-
location: "Rocktown, GA",
|
19
|
-
link: "https://www.youtube.com/results?q=Rocktown+bouldering&sp=CAI%253D"
|
20
|
-
},
|
21
|
-
"5" => {
|
22
|
-
location: "Rumbling Bald, NC",
|
23
|
-
link: "https://www.youtube.com/results?q=rumbling+bald+bouldering&sp=CAI%253D"
|
24
|
-
},
|
25
|
-
"6" => {
|
26
|
-
location: "Stone Fort (LRC), TN",
|
27
|
-
link: "https://www.youtube.com/results?sp=CAI%253D&q=Stone+Fort+LRC+bouldering"
|
28
|
-
}
|
29
|
-
}
|
30
|
-
end
|
3
|
+
#module SeClimbingVideos
|
4
|
+
#
|
5
|
+
#end
|
6
|
+
|
7
|
+
require 'pry'
|
8
|
+
require 'nokogiri'
|
9
|
+
require 'open-uri'
|
10
|
+
require 'colorize'
|
11
|
+
|
12
|
+
require_relative '../lib/se_climbing_videos/version'
|
13
|
+
require_relative '../lib/se_climbing_videos/cli'
|
14
|
+
require_relative '../lib/se_climbing_videos/scraper'
|
15
|
+
require_relative '../lib/se_climbing_videos/video'
|
@@ -1,5 +1,32 @@
|
|
1
1
|
class SeClimbingVideos::CLI
|
2
2
|
|
3
|
+
SEARCH_LINKS = {
|
4
|
+
"1" => {
|
5
|
+
location: "Boone, NC",
|
6
|
+
link: "https://www.youtube.com/results?sp=CAI%253D&q=Boone+NC+bouldering"
|
7
|
+
},
|
8
|
+
"2" => {
|
9
|
+
location: "Grayson Highlands, VA",
|
10
|
+
link: "https://www.youtube.com/results?q=Grayson+Highlands+bouldering&sp=CAI%253D"
|
11
|
+
},
|
12
|
+
"3" => {
|
13
|
+
location: "Horse Pens 40, AL",
|
14
|
+
link: "https://www.youtube.com/results?q=horse+pens+40+bouldering&sp=CAI%253D"
|
15
|
+
},
|
16
|
+
"4" => {
|
17
|
+
location: "Rocktown, GA",
|
18
|
+
link: "https://www.youtube.com/results?q=Rocktown+bouldering&sp=CAI%253D"
|
19
|
+
},
|
20
|
+
"5" => {
|
21
|
+
location: "Rumbling Bald, NC",
|
22
|
+
link: "https://www.youtube.com/results?q=rumbling+bald+bouldering&sp=CAI%253D"
|
23
|
+
},
|
24
|
+
"6" => {
|
25
|
+
location: "Stone Fort (LRC), TN",
|
26
|
+
link: "https://www.youtube.com/results?sp=CAI%253D&q=Stone+Fort+LRC+bouldering"
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
3
30
|
attr_accessor :location_input
|
4
31
|
|
5
32
|
def call
|
@@ -30,7 +57,7 @@ class SeClimbingVideos::CLI
|
|
30
57
|
self.location_input = gets.strip
|
31
58
|
|
32
59
|
if ["1", "2", "3", "4", "5", "6"].include?(@location_input)
|
33
|
-
SeClimbingVideos::Scraper.new.make_videos(SeClimbingVideos::SEARCH_LINKS[@location_input][:link], SeClimbingVideos::SEARCH_LINKS[@location_input][:location])
|
60
|
+
SeClimbingVideos::Scraper.new.make_videos(SeClimbingVideos::CLI::SEARCH_LINKS[@location_input][:link], SeClimbingVideos::CLI::SEARCH_LINKS[@location_input][:location])
|
34
61
|
|
35
62
|
elsif @location_input =="exit"
|
36
63
|
goodbye
|
@@ -42,10 +69,10 @@ class SeClimbingVideos::CLI
|
|
42
69
|
end
|
43
70
|
|
44
71
|
def print_videos
|
45
|
-
puts "---Latest 20 videos from #{SeClimbingVideos::SEARCH_LINKS[@location_input][:location]}---".colorize(:light_blue)
|
72
|
+
puts "---Latest 20 videos from #{SeClimbingVideos::CLI::SEARCH_LINKS[@location_input][:location]}---".colorize(:light_blue)
|
46
73
|
puts ""
|
47
74
|
SeClimbingVideos::Video.all.each.with_index(1) do |video, i|
|
48
|
-
if video.location == SeClimbingVideos::SEARCH_LINKS[@location_input][:location]
|
75
|
+
if video.location == SeClimbingVideos::CLI::SEARCH_LINKS[@location_input][:location]
|
49
76
|
puts "#{i}. "+"#{video.name}".colorize(:light_blue)+" - #{video.upload_user} - #{video.upload_date}"
|
50
77
|
end
|
51
78
|
end
|
data/se_climbing_videos.gemspec
CHANGED
@@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
28
28
|
f.match(%r{^(test|spec|features)/})
|
29
29
|
end
|
30
|
-
spec.files << "config/environment.rb"
|
31
30
|
spec.bindir = "bin"
|
32
31
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
32
|
spec.require_paths = ["lib"]
|