Class: NycWorkspaceFinder::Scraper
- Inherits:
-
Object
- Object
- NycWorkspaceFinder::Scraper
- Defined in:
- lib/nyc_workspace_finder/scraper.rb
Instance Attribute Summary collapse
-
#computer_station ⇒ Object
Returns the value of attribute computer_station.
-
#dedicated_desk ⇒ Object
Returns the value of attribute dedicated_desk.
-
#ft_desks ⇒ Object
Returns the value of attribute ft_desks.
-
#limited ⇒ Object
Returns the value of attribute limited.
-
#monthly ⇒ Object
Returns the value of attribute monthly.
-
#nights_weekends ⇒ Object
Returns the value of attribute nights_weekends.
-
#open_desk ⇒ Object
Returns the value of attribute open_desk.
-
#pt_workspace ⇒ Object
Returns the value of attribute pt_workspace.
-
#pvt_offce ⇒ Object
Returns the value of attribute pvt_offce.
-
#rates ⇒ Object
Returns the value of attribute rates.
-
#virtual ⇒ Object
Returns the value of attribute virtual.
Instance Method Summary collapse
- #scrape_brooklyncreativeleague ⇒ Object
- #scrape_conartist_nyc ⇒ Object
- #scrape_nospace ⇒ Object
- #scrape_productive ⇒ Object
Instance Attribute Details
#computer_station ⇒ Object
Returns the value of attribute computer_station.
8 9 10 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 8 def computer_station @computer_station end |
#dedicated_desk ⇒ Object
Returns the value of attribute dedicated_desk.
8 9 10 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 8 def dedicated_desk @dedicated_desk end |
#ft_desks ⇒ Object
Returns the value of attribute ft_desks.
8 9 10 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 8 def ft_desks @ft_desks end |
#limited ⇒ Object
Returns the value of attribute limited.
8 9 10 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 8 def limited @limited end |
#monthly ⇒ Object
Returns the value of attribute monthly.
8 9 10 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 8 def monthly @monthly end |
#nights_weekends ⇒ Object
Returns the value of attribute nights_weekends.
8 9 10 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 8 def nights_weekends @nights_weekends end |
#open_desk ⇒ Object
Returns the value of attribute open_desk.
8 9 10 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 8 def open_desk @open_desk end |
#pt_workspace ⇒ Object
Returns the value of attribute pt_workspace.
8 9 10 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 8 def pt_workspace @pt_workspace end |
#pvt_offce ⇒ Object
Returns the value of attribute pvt_offce.
8 9 10 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 8 def pvt_offce @pvt_offce end |
#rates ⇒ Object
Returns the value of attribute rates.
8 9 10 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 8 def rates @rates end |
#virtual ⇒ Object
Returns the value of attribute virtual.
8 9 10 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 8 def virtual @virtual end |
Instance Method Details
#scrape_brooklyncreativeleague ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 25 def scrape_brooklyncreativeleague doc = Nokogiri::HTML(open("http://brooklyncreativeleague.com/workspace/")) self.pvt_offce = "Private Offices: #{doc.search("section p")[1].text.gsub(" Details »", "")}" self.ft_desks = "Full-time desks: #{doc.search("section p")[2].text.gsub(" Details »", "")}" self.pt_workspace = "Part-time Workspace: #{doc.search("section p")[3].text.gsub(" Details »", "")}" self.virtual = "Virtual Office: #{doc.search("section p")[4].text.gsub(" Details »", "")}" end |
#scrape_conartist_nyc ⇒ Object
33 34 35 36 37 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 33 def scrape_conartist_nyc doc = Nokogiri::HTML(open("http://conartistnyc.com/blogs/news/10543057-need-workspace")) self.limited = doc.search("div.post-content p").text.match(/LIMITED(.*)9\sa\sweek./).to_s self.monthly = doc.search("div.post-content p").text.match(/MONTHLY(.*)5./).to_s end |
#scrape_nospace ⇒ Object
20 21 22 23 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 20 def scrape_nospace doc = Nokogiri::HTML(open("http://notanalternative.org/2011/05/17/coworking-no%E2%86%94space-featured-in-ny-post/")) self.rates = doc.search("div p")[1].text end |
#scrape_productive ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/nyc_workspace_finder/scraper.rb', line 12 def scrape_productive doc = Nokogiri::HTML(open("http://theproductivenyc.com/prices/")) self.open_desk = doc.search("tr td").first.text[1..-1].split.join(' ') self.computer_station = doc.search("tr td")[1].text[1..-1].split.join(' ') self.nights_weekends = doc.search("tr td")[2].text.split.join(' ') self.dedicated_desk = doc.search("tr td")[3].text[1..-1].split.join(' ') end |