musicscrape 0.0.9 → 0.0.10

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.9
1
+ 0.0.10
data/lib/musicscrape.rb CHANGED
@@ -2,6 +2,7 @@ require 'rubygems'
2
2
  require 'rest-client'
3
3
  #call musicscrape with no arguments from the command line for output
4
4
 
5
+
5
6
  #This gem goes to www.thestranger.com/seattle/Music and scrapes data for all the recommended concerts.
6
7
  #The one method you need is get_music_listings which returns an array of hashes of the form
7
8
  #[[:title=> "", :venue=>"", :date=>"", :details=>""], ...]
@@ -18,9 +19,19 @@ class Scrape
18
19
  @source_type = source_type
19
20
  @url="http://www.thestranger.com/seattle/Music"
20
21
  end
22
+ def formatted_output
23
+ #gives you the same output you get from the command line
24
+ @scrape = Scrape.new
25
+ @scrape.get_music_listings.each do |lst|
26
+ puts lst[:title]
27
+ puts lst[:venue]
28
+ puts lst[:date]
29
+ puts lst[:details]
30
+ puts "\n"
31
+ end
21
32
 
22
33
  def get_music_listings
23
- #This is the one method you need to use
34
+ #Gives you an array of hashes
24
35
  @scrape = Scrape.new(:web)
25
36
  @pruned_page = @scrape.remove_excess(@scrape.load_page)
26
37
  @scrape.get_events(@pruned_page) #returns an array of hashes
Binary file
data/musicscrape.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "musicscrape"
8
- s.version = "0.0.9"
8
+ s.version = "0.0.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["tallbryan"]
@@ -36,6 +36,7 @@ Gem::Specification.new do |s|
36
36
  "musicscrape-0.0.6.gem",
37
37
  "musicscrape-0.0.7.gem",
38
38
  "musicscrape-0.0.8.gem",
39
+ "musicscrape-0.0.9.gem",
39
40
  "musicscrape.gemspec",
40
41
  "rakefile.rb"
41
42
  ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: musicscrape
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -134,6 +134,7 @@ files:
134
134
  - musicscrape-0.0.6.gem
135
135
  - musicscrape-0.0.7.gem
136
136
  - musicscrape-0.0.8.gem
137
+ - musicscrape-0.0.9.gem
137
138
  - musicscrape.gemspec
138
139
  - rakefile.rb
139
140
  homepage: http://github.com/tallbryan/musicscrape