breathe_in 0.3.0 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4069e0b4bd4f6299ffbd1b83b9ac0cd7563fb0d5
4
- data.tar.gz: bf233b2b6b9fee7d2519a06e21871667f39753a2
3
+ metadata.gz: 518500085648f4aaa924eaa5d3ab5198c44a5b47
4
+ data.tar.gz: 27670870139f6d47442a943b9953073b807fbd55
5
5
  SHA512:
6
- metadata.gz: 88d5e57eb2ec40f57278b3dd906997398d2efd37c4887f909ab6a1b135f1672057c4e65710cbd874e0d1f824491ff641ccad37caf15644959bf8dbbcebb03a0a
7
- data.tar.gz: 38d2714fc0805438d341d28189ff905d06cdba785a02c1162f8e9189538ce32fea0c668f6412256beb082f1fa48e7a2ff5a8e8c2b31ae2f3f0e685ed32d16406
6
+ metadata.gz: ab340cfefbb7620327796e00d7f77d02d223c5d1172ab453f04e66ecb933ed84733df4b90e49eb8336fdf6cbcd0836ac70f804b7520f5bb953ea7c2af2637ca6
7
+ data.tar.gz: 32a44d843c48b6800841586f9f8e7acd1e5b1685b4fecbd1a26fd8b1fcd06a343aa8305a50c51a9fcb6b593b4d59c1b466266d6b16fe5f5f13b8965353befea4
data/bin/breathe_in CHANGED
@@ -4,4 +4,26 @@ require "breathe_in"
4
4
 
5
5
  BreatheIn::CLI.new.run
6
6
 
7
+ # or:
8
+ # require "bundler"
9
+ # Bundler.require
10
+ # this will clear the load path
11
+ # or:
12
+ # require_relative '../lib/breathe_in'
7
13
 
14
+ # 1. CLI asks for a city.
15
+ # 2. city checks if we have that city, if not
16
+ # 3. Scrape it and create the instance of that city
17
+ # 3. cli has the city
18
+
19
+ # The cli is just relying on the city classes abilit to find a city.
20
+ # City class is relying on the scraper class to get data for itself.
21
+
22
+ # 1. cli.
23
+ # 2. city
24
+ # 3. scraper
25
+
26
+
27
+ # cli
28
+ # a. scraper
29
+ # or b .city
@@ -28,6 +28,20 @@ class BreatheIn::CLI
28
28
  end
29
29
  end
30
30
 
31
+ # def get_information
32
+ # get_zipcode
33
+ # @city = BreatheIn::City.find_by_zipcode({zipcode: self.class.zipcode})
34
+ # scrape_data BreatheIn::City.new({zipcode: self.class.zipcode})
35
+ # if BreatheIn::Scraper.city_name == nil
36
+ # puts "That zipcode is not recognized by AirNow.gov."
37
+ # get_information
38
+ # else
39
+ # new_city = BreatheIn::City.new({zipcode: self.class.zipcode})
40
+ # assign_attributes(new_city)
41
+ # display_information
42
+ # end
43
+ # end
44
+
31
45
  def check_site_availability
32
46
  if BreatheIn::Scraper.under_maintenance
33
47
  disclaimer = <<-Ruby
@@ -13,7 +13,7 @@ class BreatheIn::Scraper
13
13
 
14
14
  def self.scraped_page(zipcode)
15
15
  begin
16
- @@scraped = Nokogiri::HTML(open("http://airnow.gov/?action=airnow.local_city&zipcode=#{zipcode}&submit=Go"))
16
+ @@scraped = Nokogiri::HTML(open("http://airnow.gov/?action=airnow.local_city&zipcode=92505&submit=Go", :allow_redirections => :all))
17
17
  rescue OpenURI::HTTPError => e
18
18
  if e.message == '404 Not Found'
19
19
  puts "The website is currently down. Pleaes try again later."
@@ -1,3 +1,3 @@
1
1
  module BreatheIn
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: breathe_in
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - eric-an
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-29 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler