nyc_workspace_finder 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/README.md +36 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/bin/workspace-finder +5 -0
- data/lib/nyc_workspace_finder.rb +8 -0
- data/lib/nyc_workspace_finder/cli.rb +74 -0
- data/lib/nyc_workspace_finder/data.rb +66 -0
- data/lib/nyc_workspace_finder/scraper.rb +40 -0
- data/lib/nyc_workspace_finder/version.rb +3 -0
- data/nyc_workspace_finder.gemspec +33 -0
- metadata +116 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e6945955ce68bec835ec033a41fea9ffcc837dd2
|
4
|
+
data.tar.gz: 55324e666e8a92868ba578844f7ec9853f4177b9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0ea8178f5e60fd22ef96a2446989450554eb6d36a25300de52439eef16635393676ec95eb546e3a4476e91139c9c5d877c98a256a935cd1aea0ad11ac6083d4e
|
7
|
+
data.tar.gz: 3e04ea4cc7786817654be08b1385ed604161de7db3ca3d658b610bedae1b7ae96a5114900055fa1e1a7ec74132fe6facef4b2c059531b8fd980307bcd7291c02
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# NycWorkspaceFinder
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/nyc_workspace_finder`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'nyc_workspace_finder'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install nyc_workspace_finder
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/nyc_workspace_finder. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
36
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "nyc_workspace_finder"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
class NycWorkspaceFinder::CLI
|
2
|
+
def call
|
3
|
+
puts "-------------------------------------------------------------------------------------------------------------------------------"
|
4
|
+
puts "WELCOME TO NYC WORKSPACE FINDER. PROVIDING UP-TO-DATE PRICING INFO ON UNIQUE, ART OR PUNK-ORIENTED WORKSPACES IN NEW YORK CITY!"
|
5
|
+
puts "-------------------------------------------------------------------------------------------------------------------------------"
|
6
|
+
puts ""
|
7
|
+
start
|
8
|
+
manhattan_or_brooklyn
|
9
|
+
end
|
10
|
+
|
11
|
+
def start
|
12
|
+
puts "Are you looking for a workspace in Manhattan or Brooklyn?"
|
13
|
+
@input = gets.strip.downcase
|
14
|
+
end
|
15
|
+
|
16
|
+
def manhattan_or_brooklyn
|
17
|
+
if @input == "manhattan"
|
18
|
+
puts "-------------------------------------------------------------------------------------"
|
19
|
+
puts "Please choose a workspace by number below to find out more about its pricing options."
|
20
|
+
puts "-------------------------------------------------------------------------------------"
|
21
|
+
puts ""
|
22
|
+
puts "1. THE PRODUCTIVE -- 38th St."
|
23
|
+
puts "2. CON ARTIST -- Lower East Side"
|
24
|
+
@workspace = gets.strip
|
25
|
+
manhattan_workspace_data
|
26
|
+
again
|
27
|
+
elsif @input == "brooklyn"
|
28
|
+
puts "-------------------------------------------------------------------------------------"
|
29
|
+
puts "Please choose a workspace by number below to find out more about its pricing options."
|
30
|
+
puts "-------------------------------------------------------------------------------------"
|
31
|
+
puts ""
|
32
|
+
puts "1. NO SPACE -- Greenpoint"
|
33
|
+
puts "2. BROOKLYN CREATIVE LOUNGE -- Gowanus"
|
34
|
+
@workspace = gets.strip
|
35
|
+
brooklyn_workspace_data
|
36
|
+
again
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def manhattan_workspace_data
|
41
|
+
if @workspace == "1"
|
42
|
+
NycWorkspaceFinder::Data.productive_data
|
43
|
+
elsif @workspace == "2"
|
44
|
+
NycWorkspaceFinder::Data.con_artist_data
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def brooklyn_workspace_data
|
49
|
+
if @workspace == "1"
|
50
|
+
NycWorkspaceFinder::Data.no_space_data
|
51
|
+
elsif @workspace == "2"
|
52
|
+
NycWorkspaceFinder::Data.brooklyn_creative_league_data
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def again
|
57
|
+
puts ""
|
58
|
+
puts "--------------------------------------"
|
59
|
+
puts "Would you like to see more workspaces?"
|
60
|
+
input = gets.strip.downcase
|
61
|
+
if input == "yes"
|
62
|
+
puts "----------------------"
|
63
|
+
puts "Manhattan or Brooklyn?"
|
64
|
+
puts "----------------------"
|
65
|
+
@input = gets.strip
|
66
|
+
manhattan_or_brooklyn
|
67
|
+
else
|
68
|
+
puts ""
|
69
|
+
puts "Check back later for new workspace options!"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
@@ -0,0 +1,66 @@
|
|
1
|
+
class NycWorkspaceFinder::Data
|
2
|
+
|
3
|
+
def self.productive_data
|
4
|
+
something = NycWorkspaceFinder::Scraper.new
|
5
|
+
something.scrape_productive
|
6
|
+
puts ""
|
7
|
+
puts "RATES:"
|
8
|
+
puts "-#{something.open_desk}"
|
9
|
+
puts "-#{something.computer_station}"
|
10
|
+
puts "-#{something.nights_weekends}"
|
11
|
+
puts ""
|
12
|
+
puts "ADDED INFO: dedicated to providing an energetic working environment for entrepreneurs and creative professionals; developers, animators,"
|
13
|
+
puts "digital artists, designers, writers and editors are all welcome."
|
14
|
+
puts ""
|
15
|
+
puts "ADDRESS: 40 W. 38th St. 5th floor"
|
16
|
+
puts "WEBSITE: http://theproductivenyc.com"
|
17
|
+
puts "CONTACT: info@theproductivenyc.com or call 917-668-8574"
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.no_space_data
|
21
|
+
something2 = NycWorkspaceFinder::Scraper.new
|
22
|
+
something2.scrape_nospace
|
23
|
+
puts ""
|
24
|
+
puts "#{something2.rates}"
|
25
|
+
puts ""
|
26
|
+
puts "ADDED INFO: current tenants are involved in video/film, art, journalism, marketing, graphic design, and non-profit advocacy work."
|
27
|
+
puts ""
|
28
|
+
puts "ADDRESS: 67 West St, #304, Greenpoint, Brooklyn, 11222."
|
29
|
+
puts "WEBSITE: http://notanalternative.org/2011/05/17/coworking-no↔space-featured-in-ny-post/"
|
30
|
+
puts "CONTACT: info@notanalternative.net"
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.brooklyn_creative_league_data
|
34
|
+
something3 = NycWorkspaceFinder::Scraper.new
|
35
|
+
something3.scrape_brooklyncreativeleague
|
36
|
+
puts ""
|
37
|
+
puts "RATES:"
|
38
|
+
puts "-#{something3.ft_desks}"
|
39
|
+
puts "-#{something3.pvt_offce}"
|
40
|
+
puts "-#{something3.pt_workspace}"
|
41
|
+
puts "-#{something3.virtual}"
|
42
|
+
puts ""
|
43
|
+
puts "ADDED INFO: gives freelance professionals, small-shop companies, and nonprofits the tools they need to get their work done: affordable, green shared workspace, office amenities,"
|
44
|
+
puts "and a community of professional colleagues."
|
45
|
+
puts ""
|
46
|
+
puts "ADDRESS: 540 President St, Brooklyn NY 11215"
|
47
|
+
puts "WEBSITE: http://brooklyncreativeleague.com"
|
48
|
+
puts "CONTACT: (718) 576-2104"
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.con_artist_data
|
52
|
+
something4 = NycWorkspaceFinder::Scraper.new
|
53
|
+
something4.scrape_conartist_nyc
|
54
|
+
puts ""
|
55
|
+
puts "RATES:"
|
56
|
+
puts "-#{something4.limited}"
|
57
|
+
puts "-#{something4.monthly}"
|
58
|
+
puts ""
|
59
|
+
puts "ADDED INFO: Con Artist is an art collective, community, workspace & gallery. Our venue hosts events, publications, collaboration, products, and essentially shapes the ideal circumstances for creative people and their creative pursuits. The most common reason members join the collective is for 24/7 access to our shared workspace. The two floors have all the tools necessaryto pull off most any kind of project. Our members have built nearly everything at our 119 Ludlow location, so the space is fine-tuned to perpetuate the spirit of creativity and growth."
|
60
|
+
puts ""
|
61
|
+
puts "ADDRESS: 119 Ludlow St, New York, NY 10002"
|
62
|
+
puts "WEBSITE: http://conartistnyc.com"
|
63
|
+
puts "CONTACT: (646) 504-2323"
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'pry'
|
2
|
+
require 'open-uri'
|
3
|
+
require 'nokogiri'
|
4
|
+
require 'pry'
|
5
|
+
|
6
|
+
class NycWorkspaceFinder::Scraper
|
7
|
+
|
8
|
+
attr_accessor :computer_station, :open_desk, :nights_weekends,
|
9
|
+
:dedicated_desk, :rates, :ft_desks, :pvt_offce, :pt_workspace,
|
10
|
+
:virtual, :limited, :monthly
|
11
|
+
|
12
|
+
def scrape_productive
|
13
|
+
doc = Nokogiri::HTML(open("http://theproductivenyc.com/prices/"))
|
14
|
+
self.open_desk = doc.search("tr td").first.text[1..-1].split.join(' ')
|
15
|
+
self.computer_station = doc.search("tr td")[1].text[1..-1].split.join(' ')
|
16
|
+
self.nights_weekends = doc.search("tr td")[2].text.split.join(' ')
|
17
|
+
self.dedicated_desk = doc.search("tr td")[3].text[1..-1].split.join(' ')
|
18
|
+
end
|
19
|
+
|
20
|
+
def scrape_nospace
|
21
|
+
doc = Nokogiri::HTML(open("http://notanalternative.org/2011/05/17/coworking-no%E2%86%94space-featured-in-ny-post/"))
|
22
|
+
self.rates = doc.search("div p")[1].text
|
23
|
+
end
|
24
|
+
|
25
|
+
def scrape_brooklyncreativeleague
|
26
|
+
doc = Nokogiri::HTML(open("http://brooklyncreativeleague.com/workspace/"))
|
27
|
+
self.pvt_offce = "Private Offices: #{doc.search("section p")[1].text.gsub(" Details »", "")}"
|
28
|
+
self.ft_desks = "Full-time desks: #{doc.search("section p")[2].text.gsub(" Details »", "")}"
|
29
|
+
self.pt_workspace = "Part-time Workspace: #{doc.search("section p")[3].text.gsub(" Details »", "")}"
|
30
|
+
self.virtual = "Virtual Office: #{doc.search("section p")[4].text.gsub(" Details »", "")}"
|
31
|
+
end
|
32
|
+
|
33
|
+
def scrape_conartist_nyc
|
34
|
+
doc = Nokogiri::HTML(open("http://conartistnyc.com/blogs/news/10543057-need-workspace"))
|
35
|
+
self.limited = doc.search("div.post-content p").text.match(/LIMITED(.*)9\sa\sweek./).to_s
|
36
|
+
self.monthly = doc.search("div.post-content p").text.match(/MONTHLY(.*)5./).to_s
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'nyc_workspace_finder/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "nyc_workspace_finder"
|
8
|
+
spec.version = NycWorkspaceFinder::VERSION
|
9
|
+
spec.authors = ["jwolfe890"]
|
10
|
+
spec.email = ["jwolfe890@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = "PROVIDES UP-TO-DATE PRICING INFO ON UNIQUE, ART OR PUNK-ORIENTED WORKSPACES IN NEW YORK CITY!."
|
13
|
+
spec.description = "PROVIDES UP-TO-DATE PRICING INFO ON UNIQUE, ART OR PUNK-ORIENTED WORKSPACES IN NEW YORK CITY!"
|
14
|
+
spec.homepage = "https://github.com/jwolfe890/nyc_workspace_finder"
|
15
|
+
|
16
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
17
|
+
# delete this section to allow pushing this gem to any host.
|
18
|
+
# if spec.respond_to?(:metadata)
|
19
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
20
|
+
# else
|
21
|
+
# raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
22
|
+
# end
|
23
|
+
|
24
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
30
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
+
spec.add_dependency "nokogiri", ">= 0"
|
32
|
+
spec.add_development_dependency "pry"
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nyc_workspace_finder
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- jwolfe890
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-06-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.10'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.10'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: nokogiri
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: PROVIDES UP-TO-DATE PRICING INFO ON UNIQUE, ART OR PUNK-ORIENTED WORKSPACES
|
70
|
+
IN NEW YORK CITY!
|
71
|
+
email:
|
72
|
+
- jwolfe890@gmail.com
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- ".travis.yml"
|
79
|
+
- CODE_OF_CONDUCT.md
|
80
|
+
- Gemfile
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- bin/console
|
84
|
+
- bin/setup
|
85
|
+
- bin/workspace-finder
|
86
|
+
- lib/nyc_workspace_finder.rb
|
87
|
+
- lib/nyc_workspace_finder/cli.rb
|
88
|
+
- lib/nyc_workspace_finder/data.rb
|
89
|
+
- lib/nyc_workspace_finder/scraper.rb
|
90
|
+
- lib/nyc_workspace_finder/version.rb
|
91
|
+
- nyc_workspace_finder.gemspec
|
92
|
+
homepage: https://github.com/jwolfe890/nyc_workspace_finder
|
93
|
+
licenses: []
|
94
|
+
metadata: {}
|
95
|
+
post_install_message:
|
96
|
+
rdoc_options: []
|
97
|
+
require_paths:
|
98
|
+
- lib
|
99
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
requirements: []
|
110
|
+
rubyforge_project:
|
111
|
+
rubygems_version: 2.6.4
|
112
|
+
signing_key:
|
113
|
+
specification_version: 4
|
114
|
+
summary: PROVIDES UP-TO-DATE PRICING INFO ON UNIQUE, ART OR PUNK-ORIENTED WORKSPACES
|
115
|
+
IN NEW YORK CITY!.
|
116
|
+
test_files: []
|