billboard_hot_100_songs 0.1.0 → 1.0.0

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.
@@ -1,7 +1,7 @@
1
1
  class BillboardHot100Songs::CLI
2
2
 
3
3
  def initialize
4
- create_songs
4
+ create_songs
5
5
  @indent = " " * 12 # Adjust indent spacing to your preference
6
6
  end
7
7
 
@@ -3,14 +3,15 @@ class BillboardHot100Songs::Scraper
3
3
  BASE_PATH = "https://www.billboard.com/charts/hot-100"
4
4
 
5
5
  def self.scrape_main_page
6
-
7
6
  page_data = Nokogiri::HTML(open(BASE_PATH))
8
7
 
9
- # BACKUP HTML FOR OFFLINE USE - DATA IS FOR THE WEEK OF SEP. 5, 2020
10
- # To work offline, uncomment the next two lines below (lines 11 and 12) and comment above code + BASE_PATH (lines 3 and 7)
11
- # html_backup = File.read('/Users/Alexander/Documents/Coding/Flatiron School/3_Projects/billboard_hot_100_songs/lib/billboard_hot_100_songs/backup_website/billboard_hot_100_songs.html')
12
- # page_data = Nokogiri::HTML(html_backup)
13
-
8
+ # BACKUP HTML FOR OFFLINE USE
9
+ # To work offline, run the extractor in the backup_website folder to parse data you want to save
10
+ # To run the extractor, cd into the 'backup_website' directory. Then in your terminal enter: 'ruby extractor.rb'
11
+ # Then uncomment the next two lines below (lines 12 and 13) and comment above code + BASE_PATH (lines 3 and 7)
12
+ # html_backup = File.read('lib/billboard_hot_100_songs/backup_website/billboard_hot_100_songs.html')
13
+ # page_data = Nokogiri::HTML(html_backup)
14
+
14
15
  page_data.css("li.chart-list__element").map do |element|
15
16
  song = {}
16
17
  song[:name] = element.css("span.chart-element__information__song").text
@@ -1,3 +1,3 @@
1
1
  module BillboardHot100Songs
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billboard_hot_100_songs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander M. Clamor
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.10'
19
+ version: 2.1.4
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.10'
26
+ version: 2.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -109,6 +109,7 @@ files:
109
109
  - ".travis.yml"
110
110
  - CODE_OF_CONDUCT.md
111
111
  - Gemfile
112
+ - Gemfile.lock
112
113
  - LICENSE.txt
113
114
  - NOTES.md
114
115
  - README.md
@@ -140,9 +141,9 @@ require_paths:
140
141
  - lib
141
142
  required_ruby_version: !ruby/object:Gem::Requirement
142
143
  requirements:
143
- - - ">="
144
+ - - '='
144
145
  - !ruby/object:Gem::Version
145
- version: 2.3.0
146
+ version: 2.6.1
146
147
  required_rubygems_version: !ruby/object:Gem::Requirement
147
148
  requirements:
148
149
  - - ">="