FreeWiFiNYC 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/FreeWiFiNYC-0.1.10.gem +0 -0
- data/FreeWiFiNYC.gemspec +15 -3
- data/Gemfile +0 -1
- data/Gemfile.lock +20 -0
- data/README.md +3 -7
- data/bin/console +1 -0
- data/bin/freewifinyc +1 -1
- data/config/environment.rb +1 -1
- data/lib/FreeWiFiNYC/FreeWiFiNYC.rb +2 -2
- data/lib/FreeWiFiNYC/api.rb +11 -15
- data/lib/FreeWiFiNYC/cli.rb +13 -8
- data/lib/FreeWiFiNYC/scraper.rb +33 -53
- data/lib/FreeWiFiNYC/version.rb +1 -1
- metadata +56 -13
- data/FreeWiFiNYC-0.1.0.gem +0 -0
- data/FreeWiFiNYC-0.1.1.gem +0 -0
- data/lib/FreeWiFiNYC.rb +0 -186
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c16865ac9188e7156da737c3c7f8993ece896c2bc410fb6123d9742a0431f49
|
4
|
+
data.tar.gz: c442e18cd2177abf05e267514181205ed01bded9159cf3dacf4d8f041e47b691
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f78b543a836eda45a9438c72c06e39c7ae3b8953d64bb5df35b09315b6e199203905c8661f99f9cdb8bad6e239d11cdd2f68065b9365d7a84aef52c62ab1aca9
|
7
|
+
data.tar.gz: '098f0f749bf3d18877b034ec6b357979f9d1c1b9f78aa04744373528e0e2d99631b9f1f0f200a80859d3c3a0e35375d13c7ed3bf5a77e3b1d3d69de608d2fd5f'
|
Binary file
|
data/FreeWiFiNYC.gemspec
CHANGED
@@ -9,8 +9,15 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["jaredjames2020"]
|
10
10
|
spec.email = ["jaredjames2020@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = %q{
|
13
|
-
|
12
|
+
spec.summary = %q{Finding free WiFi in New York City has never been easier.
|
13
|
+
Search for WiFi locations in any New York City neighborhood near you.}
|
14
|
+
spec.description = %q{Accessing the internet in New York City is now easier than ever.
|
15
|
+
Free public WiFi can be found throughout New York City
|
16
|
+
in places like subway stations, neighborhood kiosks,
|
17
|
+
hotels, cafés, libraries, restaurants, shops, and many
|
18
|
+
more places. In an effort to help both locals and visitors
|
19
|
+
stay connected, you can use this search tool to find WiFi
|
20
|
+
locations in any New York City neighborhood near you. }
|
14
21
|
spec.homepage = "https://github.com/jaredjames2020/FreeWiFiNYC"
|
15
22
|
spec.license = "MIT"
|
16
23
|
|
@@ -20,8 +27,13 @@ Gem::Specification.new do |spec|
|
|
20
27
|
spec.bindir = "bin"
|
21
28
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
22
29
|
spec.executables << "freewifinyc"
|
23
|
-
spec.require_paths = ["lib"
|
30
|
+
spec.require_paths = ["lib"]
|
24
31
|
|
25
32
|
spec.add_development_dependency "bundler", "~> 1.16"
|
26
33
|
spec.add_development_dependency "rake", "~> 10.0"
|
34
|
+
spec.add_development_dependency "pry"
|
35
|
+
|
36
|
+
spec.add_dependency "nokogiri"
|
37
|
+
spec.add_dependency "json"
|
38
|
+
|
27
39
|
end
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
data/README.md
CHANGED
@@ -2,10 +2,6 @@
|
|
2
2
|
|
3
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/FreeWiFiNYC`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
4
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
|
-
test test
|
8
|
-
|
9
5
|
## Installation
|
10
6
|
|
11
7
|
Add this line to your application's Gemfile:
|
@@ -24,7 +20,7 @@ Or install it yourself as:
|
|
24
20
|
|
25
21
|
## Usage
|
26
22
|
|
27
|
-
|
23
|
+
Finding free WiFi in New York City has never been easier. You can search for WiFi locations in any New York City neighborhood. Utilize the menu selections to search by zip code or by borough. Your search will provide a list of street addressed neighborhood WiFi locations.
|
28
24
|
|
29
25
|
## Development
|
30
26
|
|
@@ -34,7 +30,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
34
30
|
|
35
31
|
## Contributing
|
36
32
|
|
37
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/jaredjames2020/FreeWiFiNYC. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
38
34
|
|
39
35
|
## License
|
40
36
|
|
@@ -42,4 +38,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
42
38
|
|
43
39
|
## Code of Conduct
|
44
40
|
|
45
|
-
Everyone interacting in the FreeWiFiNYC project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
41
|
+
Everyone interacting in the FreeWiFiNYC project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/jaredjames2020/FreeWiFiNYC/blob/master/CODE_OF_CONDUCT.md).
|
data/bin/console
CHANGED
data/bin/freewifinyc
CHANGED
data/config/environment.rb
CHANGED
@@ -3,7 +3,7 @@ require 'open-uri'
|
|
3
3
|
require 'json'
|
4
4
|
require 'pry'
|
5
5
|
|
6
|
-
require_relative '../lib/
|
6
|
+
require_relative '../lib/FreeWiFiNY/freewifinyc'
|
7
7
|
require_relative '../lib/FreeWiFiNYC/scraper' #all the lib files to the app
|
8
8
|
require_relative '../lib/FreeWiFiNYC/cli'
|
9
9
|
require_relative '../lib/FreeWiFiNYC/api'
|
data/lib/FreeWiFiNYC/api.rb
CHANGED
@@ -1,39 +1,37 @@
|
|
1
1
|
class Api
|
2
2
|
|
3
|
-
attr_accessor :borough_name, :neighborhood_name
|
4
|
-
|
5
|
-
puts "API Class"
|
3
|
+
#attr_accessor :borough_name, :neighborhood_name
|
6
4
|
|
7
5
|
def self.neighborhood
|
8
6
|
puts "This is a list of the Wifi locations by neighborhood in #{Cli.borough_name}.\n"
|
9
7
|
neighborhood_array = []
|
10
|
-
# @data.each do |each_entry|
|
11
8
|
Scraper.all_data.each do |each_entry|
|
12
9
|
if each_entry["boroname"] == Cli.borough_name
|
13
10
|
neighborhood_list = "#{each_entry["ntaname"]} - #{each_entry["location_t"]} - #{each_entry["location"]}"
|
14
11
|
neighborhood_array << neighborhood_list unless neighborhood_array.include?(neighborhood_list)
|
15
|
-
end
|
16
|
-
end
|
12
|
+
end #if
|
13
|
+
end #do
|
17
14
|
puts neighborhood_array.sort
|
18
15
|
Cli.search_again_met
|
19
16
|
end
|
20
17
|
|
21
18
|
def self.zip_code
|
22
19
|
puts "\nSearching for WiFi in zip code: #{Cli.find_wifi_input}\n\n"
|
23
|
-
puts "\n
|
24
|
-
puts "
|
25
|
-
puts "
|
20
|
+
puts "\n.\n"
|
21
|
+
puts "..."
|
22
|
+
puts "....."
|
23
|
+
puts "......."
|
24
|
+
puts "........."
|
26
25
|
puts "\n"
|
27
26
|
puts "You can find free WiFi at the following locations: \n"
|
28
27
|
zip_array = []
|
29
28
|
|
30
|
-
# @data.each do |each_entry|
|
31
29
|
Scraper.all_data.each do |each_entry|
|
32
30
|
if each_entry["zip"] == Cli.find_wifi_input
|
33
31
|
zip_list = "#{each_entry["ntaname"]} - #{each_entry["location_t"]} - #{each_entry["location"]}"
|
34
32
|
zip_array << zip_list unless zip_array.include?(zip_list)
|
35
|
-
|
36
|
-
|
33
|
+
end #if
|
34
|
+
end #do
|
37
35
|
puts zip_array.sort
|
38
36
|
Cli.search_again_met
|
39
37
|
end
|
@@ -42,20 +40,18 @@ class Api
|
|
42
40
|
puts "Please select a #{@borough} neighborhood."
|
43
41
|
neighborhood_array = []
|
44
42
|
neighboorhood_hash = Hash.new
|
45
|
-
# @data.each do |each_entry|
|
46
43
|
Scraper.all_data.each do |each_entry|
|
47
44
|
if each_entry["boroname"] == Cli.borough_name
|
48
45
|
neighborhood_list = "#{each_entry["ntaname"]}"
|
49
46
|
neighborhood_array << neighborhood_list unless neighborhood_array.include?(neighborhood_list)
|
50
47
|
end #if
|
51
|
-
end #do
|
48
|
+
end #do
|
52
49
|
neighborhood_array.sort.each.with_index(1) do |neighborhood,i|
|
53
50
|
puts "#{i} - #{neighborhood}"
|
54
51
|
neighboorhood_hash[i] = neighborhood
|
55
52
|
end #do
|
56
53
|
puts "\nPlease select a neighborhood to search."
|
57
54
|
neighborhood_search = gets.chomp.upcase
|
58
|
-
# @data.each do |each_entry|
|
59
55
|
Scraper.all_data.each do |each_entry|
|
60
56
|
neighborhood_list_array = []
|
61
57
|
if each_entry["ntaname"] == neighboorhood_hash[neighborhood_search.to_i]
|
data/lib/FreeWiFiNYC/cli.rb
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
class Cli
|
2
2
|
|
3
|
-
puts "Cli Class"
|
4
|
-
|
5
3
|
def self.call
|
6
4
|
Scraper.scrape_data
|
7
5
|
welcome
|
@@ -9,7 +7,15 @@ class Cli
|
|
9
7
|
end
|
10
8
|
|
11
9
|
def self.welcome
|
12
|
-
puts "
|
10
|
+
puts ""
|
11
|
+
puts "-----------------------------------------"
|
12
|
+
puts ""
|
13
|
+
puts " FREE WIFI NYC"
|
14
|
+
puts ""
|
15
|
+
puts "-----------------------------------------"
|
16
|
+
|
17
|
+
puts "\nHello, I can help you find free Wi-Fi in New York City."
|
18
|
+
puts "You can search by zip code or neighborhood."
|
13
19
|
end
|
14
20
|
|
15
21
|
def self.goodbye
|
@@ -17,12 +23,11 @@ class Cli
|
|
17
23
|
end
|
18
24
|
|
19
25
|
def self.find_wifi
|
20
|
-
puts "
|
26
|
+
puts "\nPlease enter a zip code or type 'help' to search by neighborhood or type 'exit':"
|
21
27
|
@find_wifi_input = gets.chomp.upcase
|
22
28
|
|
23
29
|
if @find_wifi_input == "HELP"
|
24
30
|
borough_selector
|
25
|
-
# elsif @zip_codes.include?(@find_wifi_input)
|
26
31
|
elsif Scraper.zips.include?(@find_wifi_input)
|
27
32
|
Api.zip_code
|
28
33
|
elsif @find_wifi_input == "EXIT"
|
@@ -31,7 +36,7 @@ class Cli
|
|
31
36
|
puts "Invalid entry. Please enter a 5 digit NYC zip code."
|
32
37
|
find_wifi
|
33
38
|
else
|
34
|
-
Scraper.
|
39
|
+
Scraper.zips.include?(@find_wifi_input) || Scraper.backup_nyc_zips.include?(@find_wifi_input.to_i) ?
|
35
40
|
(puts "Sorry there is no free wifi in this area of NYC.\nType 'help' to search by neighborhood.")
|
36
41
|
: (puts "Invalid entry. Type 'help' to search by neighborhood.")
|
37
42
|
find_wifi
|
@@ -81,8 +86,8 @@ class Cli
|
|
81
86
|
end
|
82
87
|
|
83
88
|
def self.borough_assigner
|
84
|
-
borough = gets.chomp.upcase
|
85
|
-
case borough
|
89
|
+
@borough = gets.chomp.upcase
|
90
|
+
case @borough
|
86
91
|
when "1"
|
87
92
|
puts "Bronx"
|
88
93
|
@borough = "Bronx"
|
data/lib/FreeWiFiNYC/scraper.rb
CHANGED
@@ -3,9 +3,7 @@
|
|
3
3
|
|
4
4
|
class Scraper
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
attr_accessor :data, :zip_codes, :find_wifi_input, :borough, :boro_code, :all_nyc_zips
|
6
|
+
attr_accessor :data, :zip_codes, :find_wifi_input, :borough, :all_nyc_zips
|
9
7
|
|
10
8
|
def test
|
11
9
|
puts "Scraper Test"
|
@@ -16,70 +14,52 @@ class Scraper
|
|
16
14
|
@zip_codes = []
|
17
15
|
|
18
16
|
parsed_data = Nokogiri::HTML(open("https://data.cityofnewyork.us/resource/yjub-udmw.json?$offset=0&$limit=5000"))
|
19
|
-
|
17
|
+
zips_nyc_data = Nokogiri::HTML(open("http://www.city-data.com/zipmaps/New-York-New-York.html"))
|
18
|
+
backup_zips = Nokogiri::HTML(open("https://www.health.ny.gov/statistics/cancer/registry/appendix/neighborhoods.htm"))
|
20
19
|
|
21
20
|
@data = JSON.parse(parsed_data)
|
22
|
-
|
21
|
+
@all_nyc_zips = zips_nyc_data.css("div.zip-codes a").text.scan(/\d{5}/)
|
22
|
+
@backup_nyc_zips = parsed_data.css("td").text.scan(/\d+/)
|
23
23
|
|
24
24
|
zips
|
25
25
|
end
|
26
26
|
|
27
|
-
def self.zipcode_hardcode
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
|
51
|
-
codes = [10001, 10002, 10003, 10004, 10005, 10006, 10007, 10009,
|
52
|
-
10010, 10011, 10012, 10013, 10014, 10016, 10017, 10018, 10019, 10020,
|
53
|
-
10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030,
|
54
|
-
10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040,
|
55
|
-
10044, 10065, 10069, 10075, 10103, 10110, 10111, 10112, 10115, 10119,
|
56
|
-
10128, 10152, 10153, 10154, 10162, 10165, 10167, 10168, 10169, 10170,
|
57
|
-
10171, 10172, 10173, 10174, 10177, 10199, 10271, 10278, 10279, 10280,
|
58
|
-
10282, 10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309,
|
59
|
-
10310, 10311, 10312, 10314, 10451, 10452, 10453, 10454, 10455, 10456,
|
60
|
-
10457, 10458, 10459, 10460, 10461, 10462, 10463, 10464, 10465, 10466,
|
61
|
-
10467, 10468, 10469, 10470, 10471, 10472, 10473, 10474, 10475, 11001,
|
62
|
-
11003, 11004, 11005, 11040, 11101, 11102, 11103, 11104, 11105, 11106,
|
63
|
-
11109, 11201, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210,
|
64
|
-
11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220,
|
65
|
-
11221, 11222, 11223, 11224, 11225, 11226, 11228, 11229, 11230, 11231,
|
66
|
-
11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11351, 11354,
|
67
|
-
11355, 11356, 11357, 11358, 11359, 11360, 11361, 11362, 11363, 11364,
|
68
|
-
11365, 11366, 11367, 11368, 11369, 11370, 11371, 11372, 11373, 11374,
|
69
|
-
11375, 11377, 11378, 11379, 11385, 11411, 11412, 11413, 11414, 11415,
|
70
|
-
11416, 11417, 11418, 11419, 11420, 11421, 11422, 11423, 11424, 11425,
|
71
|
-
11426, 11427, 11428, 11429, 11430, 11432, 11433, 11434, 11435, 11436,
|
72
|
-
11451, 11691, 11692, 11693, 11694, 11697]
|
73
|
-
end
|
27
|
+
# def self.zipcode_hardcode
|
28
|
+
# codes = [10001, 10002, 10003, 10004, 10005, 10006, 10007, 10009,
|
29
|
+
# 10010, 10011, 10012, 10013, 10014, 10016, 10017, 10018, 10019, 10020,
|
30
|
+
# 10021, 10022, 10023, 10024, 10025, 10026, 10027, 10028, 10029, 10030,
|
31
|
+
# 10031, 10032, 10033, 10034, 10035, 10036, 10037, 10038, 10039, 10040,
|
32
|
+
# 10044, 10065, 10069, 10075, 10103, 10110, 10111, 10112, 10115, 10119,
|
33
|
+
# 10128, 10152, 10153, 10154, 10162, 10165, 10167, 10168, 10169, 10170,
|
34
|
+
# 10171, 10172, 10173, 10174, 10177, 10199, 10271, 10278, 10279, 10280,
|
35
|
+
# 10282, 10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309,
|
36
|
+
# 10310, 10311, 10312, 10314, 10451, 10452, 10453, 10454, 10455, 10456,
|
37
|
+
# 10457, 10458, 10459, 10460, 10461, 10462, 10463, 10464, 10465, 10466,
|
38
|
+
# 10467, 10468, 10469, 10470, 10471, 10472, 10473, 10474, 10475, 11001,
|
39
|
+
# 11003, 11004, 11005, 11040, 11101, 11102, 11103, 11104, 11105, 11106,
|
40
|
+
# 11109, 11201, 11203, 11204, 11205, 11206, 11207, 11208, 11209, 11210,
|
41
|
+
# 11211, 11212, 11213, 11214, 11215, 11216, 11217, 11218, 11219, 11220,
|
42
|
+
# 11221, 11222, 11223, 11224, 11225, 11226, 11228, 11229, 11230, 11231,
|
43
|
+
# 11232, 11233, 11234, 11235, 11236, 11237, 11238, 11239, 11351, 11354,
|
44
|
+
# 11355, 11356, 11357, 11358, 11359, 11360, 11361, 11362, 11363, 11364,
|
45
|
+
# 11365, 11366, 11367, 11368, 11369, 11370, 11371, 11372, 11373, 11374,
|
46
|
+
# 11375, 11377, 11378, 11379, 11385, 11411, 11412, 11413, 11414, 11415,
|
47
|
+
# 11416, 11417, 11418, 11419, 11420, 11421, 11422, 11423, 11424, 11425,
|
48
|
+
# 11426, 11427, 11428, 11429, 11430, 11432, 11433, 11434, 11435, 11436,
|
49
|
+
# 11451, 11691, 11692, 11693, 11694, 11697]
|
50
|
+
# end
|
74
51
|
|
75
52
|
def self.zips
|
76
|
-
# @data.each do |each_entry|
|
77
53
|
Scraper.all_data.each do |each_entry|
|
78
54
|
@zip_codes << each_entry["zip"] unless @zip_codes.include?(each_entry["zip"])
|
79
55
|
end
|
80
56
|
@zip_codes.sort
|
81
57
|
end
|
82
58
|
|
59
|
+
def self.backup_nyc_zips
|
60
|
+
@all_nyc_zips.sort.uniq
|
61
|
+
end
|
62
|
+
|
83
63
|
def self.all_data
|
84
64
|
@data
|
85
65
|
end
|
data/lib/FreeWiFiNYC/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: FreeWiFiNYC
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jaredjames2020
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,7 +38,55 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
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: nokogiri
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: json
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: "Accessing the internet in New York City is now easier than ever.\n Free
|
84
|
+
public WiFi can be found throughout New York City\n in
|
85
|
+
places like subway stations, neighborhood kiosks,\n hotels,
|
86
|
+
cafés, libraries, restaurants, shops, and many\n more places.
|
87
|
+
In an effort to help both locals and visitors\n stay connected,
|
88
|
+
you can use this search tool to find WiFi\n locations in
|
89
|
+
any New York City neighborhood near you. "
|
42
90
|
email:
|
43
91
|
- jaredjames2020@gmail.com
|
44
92
|
executables:
|
@@ -50,8 +98,7 @@ extra_rdoc_files: []
|
|
50
98
|
files:
|
51
99
|
- ".gitignore"
|
52
100
|
- CODE_OF_CONDUCT.md
|
53
|
-
- FreeWiFiNYC-0.1.
|
54
|
-
- FreeWiFiNYC-0.1.1.gem
|
101
|
+
- FreeWiFiNYC-0.1.10.gem
|
55
102
|
- FreeWiFiNYC-0.1.2.gem
|
56
103
|
- FreeWiFiNYC-0.1.3.gem
|
57
104
|
- FreeWiFiNYC-0.1.4.gem
|
@@ -62,6 +109,7 @@ files:
|
|
62
109
|
- FreeWiFiNYC-0.1.9.gem
|
63
110
|
- FreeWiFiNYC.gemspec
|
64
111
|
- Gemfile
|
112
|
+
- Gemfile.lock
|
65
113
|
- LICENSE.txt
|
66
114
|
- README.md
|
67
115
|
- Rakefile
|
@@ -69,7 +117,6 @@ files:
|
|
69
117
|
- bin/freewifinyc
|
70
118
|
- bin/setup
|
71
119
|
- config/environment.rb
|
72
|
-
- lib/FreeWiFiNYC.rb
|
73
120
|
- lib/FreeWiFiNYC/FreeWiFiNYC.rb
|
74
121
|
- lib/FreeWiFiNYC/api.rb
|
75
122
|
- lib/FreeWiFiNYC/cli.rb
|
@@ -83,10 +130,6 @@ post_install_message:
|
|
83
130
|
rdoc_options: []
|
84
131
|
require_paths:
|
85
132
|
- lib
|
86
|
-
- lib/FreeWiFiNYC/cli
|
87
|
-
- lib/FreeWiFiNYC/scraper
|
88
|
-
- lib/FreeWiFiNYC/FreeWiFiNYC
|
89
|
-
- lib/FreeWiFiNYC/api
|
90
133
|
required_ruby_version: !ruby/object:Gem::Requirement
|
91
134
|
requirements:
|
92
135
|
- - ">="
|
@@ -98,9 +141,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
141
|
- !ruby/object:Gem::Version
|
99
142
|
version: '0'
|
100
143
|
requirements: []
|
101
|
-
|
102
|
-
rubygems_version: 2.7.7
|
144
|
+
rubygems_version: 3.0.6
|
103
145
|
signing_key:
|
104
146
|
specification_version: 4
|
105
|
-
summary:
|
147
|
+
summary: Finding free WiFi in New York City has never been easier. Search for WiFi
|
148
|
+
locations in any New York City neighborhood near you.
|
106
149
|
test_files: []
|
data/FreeWiFiNYC-0.1.0.gem
DELETED
Binary file
|
data/FreeWiFiNYC-0.1.1.gem
DELETED
Binary file
|
data/lib/FreeWiFiNYC.rb
DELETED
@@ -1,186 +0,0 @@
|
|
1
|
-
# require "FreeWiFiNYC/version"
|
2
|
-
# require 'nokogiri'
|
3
|
-
# require 'open-uri'
|
4
|
-
# require 'json'
|
5
|
-
# require 'pry'
|
6
|
-
#
|
7
|
-
# module FreeWiFiNYC
|
8
|
-
#
|
9
|
-
# attr_accessor :data, :zip_codes, :find_wifi_input, :borough, :boro_code, :all_nyc_zips
|
10
|
-
#
|
11
|
-
# def self.initialize
|
12
|
-
# @all_nyc_zips = []
|
13
|
-
# @zip_codes = []
|
14
|
-
#
|
15
|
-
# parsed_data = Nokogiri::HTML(open("https://data.cityofnewyork.us/resource/yjub-udmw.json?$offset=0&$limit=5000"))
|
16
|
-
# zips_nyc_data = Nokogiri::HTML(open("http://www.city-data.com/zipmaps/New-York-New-York.html"))
|
17
|
-
#
|
18
|
-
# @data = JSON.parse(parsed_data)
|
19
|
-
# @all_nyc_zips = zips_nyc_data.css("div.zip-codes a").text.scan(/\d{5}/)
|
20
|
-
#
|
21
|
-
# self.zips
|
22
|
-
# self.welcome
|
23
|
-
# self.find_wifi
|
24
|
-
# end
|
25
|
-
#
|
26
|
-
# def self.zips
|
27
|
-
# @data.each do |each_entry|
|
28
|
-
# @zip_codes << each_entry["zip"] unless @zip_codes.include?(each_entry["zip"])
|
29
|
-
# end
|
30
|
-
# @zip_codes.sort
|
31
|
-
# end
|
32
|
-
#
|
33
|
-
# def self.welcome
|
34
|
-
# puts "Hello, I can help you find free Wi-Fi. You can search by zip code or neighborhood."
|
35
|
-
# end
|
36
|
-
#
|
37
|
-
# def self.find_wifi
|
38
|
-
# puts "Please enter a zip code or type 'help' to search by neighborhood or type 'exit':"
|
39
|
-
# @find_wifi_input = gets.chomp.upcase
|
40
|
-
#
|
41
|
-
# if @find_wifi_input == "HELP"
|
42
|
-
# borough
|
43
|
-
# elsif @zip_codes.include?(@find_wifi_input)
|
44
|
-
# zip_code_input
|
45
|
-
# elsif @find_wifi_input == "EXIT"
|
46
|
-
# return puts "Thanks for using Search Free Wi-Fi NYC. Goodbye!"
|
47
|
-
# elsif @find_wifi_input.length != 5
|
48
|
-
# puts "Invalid entry. Please enter a 5 digit NYC zip code."
|
49
|
-
# find_wifi
|
50
|
-
# else
|
51
|
-
# @all_nyc_zips.include?(@find_wifi_input) ?
|
52
|
-
# (puts "Sorry there is no free wifi in this area of NYC.\nType 'help' to search by neighborhood.")
|
53
|
-
# : (puts "Invalid entry. Type 'help' to search by neighborhood.")
|
54
|
-
# find_wifi
|
55
|
-
# end
|
56
|
-
# end
|
57
|
-
#
|
58
|
-
# def self.help
|
59
|
-
# puts "Enter 1 for list of neighborhoods. Enter 2 for list of location types."
|
60
|
-
# help_num = gets.chomp
|
61
|
-
# if help_num == "1"
|
62
|
-
# borough
|
63
|
-
# elsif help_num == "2"
|
64
|
-
# location_type
|
65
|
-
# else
|
66
|
-
# help
|
67
|
-
# end
|
68
|
-
# end
|
69
|
-
#
|
70
|
-
# def self.neighborhood
|
71
|
-
# puts "This is a list of the Wifi locations by neighborhood in #{@borough}.\n"
|
72
|
-
# neighborhood_array = []
|
73
|
-
#
|
74
|
-
# @data.each do |each_entry|
|
75
|
-
# if each_entry["boroname"] == @borough
|
76
|
-
# neighborhood_list = "#{each_entry["ntaname"]} - #{each_entry["location_t"]} - #{each_entry["location"]}"
|
77
|
-
# neighborhood_array << neighborhood_list unless neighborhood_array.include?(neighborhood_list)
|
78
|
-
# end
|
79
|
-
# end
|
80
|
-
# puts neighborhood_array.sort
|
81
|
-
# puts "\nWould you like to search again? Type 'Yes' or 'No'."
|
82
|
-
# search_again = gets.chomp.upcase
|
83
|
-
# if search_again == "YES"
|
84
|
-
# find_wifi
|
85
|
-
# else
|
86
|
-
# return puts "\nThanks for using Search Free Wi-Fi NYC. Goodbye!\n"
|
87
|
-
# end
|
88
|
-
# end
|
89
|
-
#
|
90
|
-
# def self.zip_code_input
|
91
|
-
# puts "\nSearching for WiFi in zip code: #{@find_wifi_input}\n\n"
|
92
|
-
# puts "You can find free WiFi at the following locations:"
|
93
|
-
# zip_array = []
|
94
|
-
#
|
95
|
-
# @data.each do |each_entry|
|
96
|
-
# if each_entry["zip"] == @find_wifi_input
|
97
|
-
# zip_list = "#{each_entry["ntaname"]} - #{each_entry["location_t"]} - #{each_entry["location"]}"
|
98
|
-
# zip_array << zip_list unless zip_array.include?(zip_list)
|
99
|
-
# end
|
100
|
-
# end
|
101
|
-
# puts zip_array.sort
|
102
|
-
# puts "\nWould you like to search again? Type 'Yes' or 'No'."
|
103
|
-
# search_again = gets.chomp.upcase
|
104
|
-
# if search_again == "YES"
|
105
|
-
# find_wifi
|
106
|
-
# else
|
107
|
-
# return puts "Thanks for using Search Free Wi-Fi NYC. Goodbye!"
|
108
|
-
# end
|
109
|
-
# end
|
110
|
-
#
|
111
|
-
# def self.borough
|
112
|
-
# puts "Please select a borough to begin your search."
|
113
|
-
# puts "
|
114
|
-
# 1 - Bronx
|
115
|
-
# 2 - Brooklyn
|
116
|
-
# 3 - Manhattan
|
117
|
-
# 4 - Queens
|
118
|
-
# 5 - Staten Island
|
119
|
-
# "
|
120
|
-
# puts "Enter a number: "
|
121
|
-
# borough = gets.chomp.upcase
|
122
|
-
# case borough
|
123
|
-
# when "1"
|
124
|
-
# puts "Bronx"
|
125
|
-
# @borough = "Bronx"
|
126
|
-
# neighborhood_list
|
127
|
-
# when "2"
|
128
|
-
# puts "Brooklyn"
|
129
|
-
# @borough = "Brooklyn"
|
130
|
-
# neighborhood_list
|
131
|
-
# when "3"
|
132
|
-
# puts "Manhattan"
|
133
|
-
# @borough = "Manhattan"
|
134
|
-
# neighborhood_list
|
135
|
-
# when "4"
|
136
|
-
# puts "Queens"
|
137
|
-
# @borough = "Queens"
|
138
|
-
# neighborhood_list
|
139
|
-
# when "5"
|
140
|
-
# puts "Staten Island"
|
141
|
-
# @borough = "Staten Island"
|
142
|
-
# neighborhood_list
|
143
|
-
# when "EXIT"
|
144
|
-
# find_wifi
|
145
|
-
# else
|
146
|
-
# puts "Enter a number 1-5 or type 'exit'.\n"
|
147
|
-
# find_wifi
|
148
|
-
# end
|
149
|
-
#
|
150
|
-
# end
|
151
|
-
#
|
152
|
-
# def self.neighborhood_list
|
153
|
-
# puts "Please select a #{@borough} neighborhood."
|
154
|
-
# neighborhood_array = []
|
155
|
-
# neighboorhood_hash = Hash.new
|
156
|
-
# @data.each do |each_entry|
|
157
|
-
# if each_entry["boroname"] == @borough
|
158
|
-
# neighborhood_list = "#{each_entry["ntaname"]}"
|
159
|
-
# neighborhood_array << neighborhood_list unless neighborhood_array.include?(neighborhood_list)
|
160
|
-
# end #if
|
161
|
-
# end #do PROBABLY GOING TO HAVE TO END THIS DO LOOP IF FAILED
|
162
|
-
# neighborhood_array.sort.each.with_index(1) do |neighborhood,i|
|
163
|
-
# puts "#{i} - #{neighborhood}"
|
164
|
-
# neighboorhood_hash[i] = neighborhood
|
165
|
-
# end #do
|
166
|
-
# puts "\nPlease select a neighborhood to search."
|
167
|
-
# search_again = gets.chomp.upcase
|
168
|
-
# @data.each do |each_entry|
|
169
|
-
# neighborhood_list_array = []
|
170
|
-
# if each_entry["ntaname"] == neighboorhood_hash[search_again.to_i]
|
171
|
-
# neighborhood_list = "#{each_entry["ntaname"]} - #{each_entry["location_t"]} - #{each_entry["location"]}"
|
172
|
-
# neighborhood_list_array << neighborhood_list unless neighborhood_list_array.include?(neighborhood_list)
|
173
|
-
# end#if
|
174
|
-
# puts neighborhood_list_array.sort
|
175
|
-
# end #do
|
176
|
-
# puts "\nWould you like to search again? Type 'Yes' or 'No'."
|
177
|
-
# search_again = gets.chomp.upcase
|
178
|
-
# if search_again == "YES"
|
179
|
-
# find_wifi
|
180
|
-
# else
|
181
|
-
# return puts "Thanks for using Search Free Wi-Fi NYC. Goodbye!"
|
182
|
-
# end#if
|
183
|
-
# end#method
|
184
|
-
#
|
185
|
-
#
|
186
|
-
# end#module
|