hidemyass2 1.0.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 +7 -0
- data/.gitignore +50 -0
- data/.travis.yml +16 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +103 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/hidemyass +5 -0
- data/lib/hidemyass/proxy.rb +178 -0
- data/lib/hidemyass/proxy_list.rb +58 -0
- data/lib/hidemyass/version.rb +3 -0
- data/lib/hidemyass.rb +96 -0
- metadata +170 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 9f58232809f330aaddd6784b94e77d764b19d56f
|
|
4
|
+
data.tar.gz: 3a1e0c97e472d9cf18eced9ff64817cc2b3c89bc
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 213cf39af8934d826e2093df37011615ceaaa454971c4f555976538e3c51b7b78f355ac8967f2780575d58a9b002adaac9fc2e39ad19d0342c35d02d906b300a
|
|
7
|
+
data.tar.gz: b9022fd597ef987ba08e6576055ac0cf50eeb149927bd75ca33abf4871aa99a7112e23ca4d6b3ef50fb2ef3c0b20521250f00ddde6b6f229ed059548767ee6a3
|
data/.gitignore
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
*.gem
|
|
2
|
+
*.rbc
|
|
3
|
+
/.config
|
|
4
|
+
/coverage/
|
|
5
|
+
/InstalledFiles
|
|
6
|
+
/pkg/
|
|
7
|
+
/spec/reports/
|
|
8
|
+
/spec/examples.txt
|
|
9
|
+
/test/tmp/
|
|
10
|
+
/test/version_tmp/
|
|
11
|
+
/tmp/
|
|
12
|
+
|
|
13
|
+
# Used by dotenv library to load environment variables.
|
|
14
|
+
# .env
|
|
15
|
+
|
|
16
|
+
## Specific to RubyMotion:
|
|
17
|
+
.dat*
|
|
18
|
+
.repl_history
|
|
19
|
+
build/
|
|
20
|
+
*.bridgesupport
|
|
21
|
+
build-iPhoneOS/
|
|
22
|
+
build-iPhoneSimulator/
|
|
23
|
+
|
|
24
|
+
## Specific to RubyMotion (use of CocoaPods):
|
|
25
|
+
#
|
|
26
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
|
27
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
|
28
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
|
29
|
+
#
|
|
30
|
+
# vendor/Pods/
|
|
31
|
+
|
|
32
|
+
## Documentation cache and generated files:
|
|
33
|
+
/.yardoc/
|
|
34
|
+
/_yardoc/
|
|
35
|
+
/doc/
|
|
36
|
+
/rdoc/
|
|
37
|
+
|
|
38
|
+
## Environment normalization:
|
|
39
|
+
/.bundle/
|
|
40
|
+
/vendor/bundle
|
|
41
|
+
/lib/bundler/man/
|
|
42
|
+
|
|
43
|
+
# for a library or gem, you might want to ignore these files since the code is
|
|
44
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
45
|
+
Gemfile.lock
|
|
46
|
+
.ruby-version
|
|
47
|
+
.ruby-gemset
|
|
48
|
+
|
|
49
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
|
50
|
+
.rvmrc
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 appPlant
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# HIDE MY ASS! /2 [](https://travis-ci.org/appPlant/hidemyass2) [](https://codeclimate.com/github/appPlant/hidemyass2) [](https://codeclimate.com/github/appPlant/hidemyass2/coverage) [](https://gemnasium.com/github.com/appPlant/hidemyass2)
|
|
2
|
+
|
|
3
|
+
Hide My Ass! /2 fetches proxies at www.hidemyass.com to allow everyone to surf privately from anywhere.
|
|
4
|
+
|
|
5
|
+
- Proxy lists are checked in real time
|
|
6
|
+
|
|
7
|
+
- Sortable by speed, with the fastest proxies listed first
|
|
8
|
+
|
|
9
|
+
- Sortable by country, anonymity, ...
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
Add this line to your application's Gemfile:
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
gem 'hidemyass2'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
And then execute:
|
|
20
|
+
|
|
21
|
+
$ bundle
|
|
22
|
+
|
|
23
|
+
Or install it yourself as:
|
|
24
|
+
|
|
25
|
+
$ gem install hidemyass2
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
To fetch all proxies simply run `HideMyAss.proxies`.
|
|
30
|
+
|
|
31
|
+
```ruby
|
|
32
|
+
require 'hidemyass'
|
|
33
|
+
|
|
34
|
+
proxies = HideMyAss.proxies
|
|
35
|
+
# => ProxyList
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
To reuse that list instead of fetching a new one use `HideMyAss.proxies!`.
|
|
39
|
+
|
|
40
|
+
To fetch proxies matching some criteria simply add filter options. Use `HideMyAss.form_data` to see and modify their defaults.
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
require 'hidemyass'
|
|
44
|
+
|
|
45
|
+
# c[] - Countries
|
|
46
|
+
# p - Port. Defaults to all ports.
|
|
47
|
+
# pr[] - Protocol. 0..2 = HTTP, HTTPS, socks4/5
|
|
48
|
+
# a[] - Anonymity level. 0..4 = None, Low, Medium, High, High +KA
|
|
49
|
+
# sp[] - Speed. 0..2 = Slow, Medium, Fast.
|
|
50
|
+
# ct[] - Connection time. 0..2 = Slow, Medium, Fast
|
|
51
|
+
# s - Sort. 0..3 = Response time, Connection time, Country A-Z.
|
|
52
|
+
# o - Order. 0, 1 = DESC, ASC.
|
|
53
|
+
# pp - Per Page. 0..3 = 10, 25, 50, 100.
|
|
54
|
+
# sortBy - Sort by. Defaults to date.
|
|
55
|
+
|
|
56
|
+
proxies = HideMyAss.proxies 'c[]' => 'FRANCE', sortBy: 'response_time'
|
|
57
|
+
|
|
58
|
+
proxies.first.country
|
|
59
|
+
# => 'FRANCE'
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Visit http://proxylist.hidemyass.com for more informations how to filter.
|
|
63
|
+
|
|
64
|
+
To get the url of each proxy call `proxy.url`.
|
|
65
|
+
|
|
66
|
+
```ruby
|
|
67
|
+
require 'hidemyass'
|
|
68
|
+
|
|
69
|
+
urls = HideMyAss.proxies.map(&:url)
|
|
70
|
+
# => ['https://178.22.148.122:3129',...]
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Refer to the [Proxy](https://github.com/appPlant/hidemyass2/blob/master/lib/hidemyass/proxy.rb) class for more advanced usage and a complete list of properties like `speed`, `ip`, `ssl?`, `anonym?` or `secure?`.
|
|
74
|
+
|
|
75
|
+
Print out all proxy urls on command line:
|
|
76
|
+
|
|
77
|
+
$ bundle exec hidemyass
|
|
78
|
+
|
|
79
|
+
## Development
|
|
80
|
+
|
|
81
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
82
|
+
|
|
83
|
+
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).
|
|
84
|
+
|
|
85
|
+
## Contributing
|
|
86
|
+
|
|
87
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/appplant/hidemyass2.
|
|
88
|
+
|
|
89
|
+
1. Fork it
|
|
90
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
|
91
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
|
92
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
|
93
|
+
5. Create new Pull Request
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
|
99
|
+
|
|
100
|
+
Made with :yum: from Leipzig
|
|
101
|
+
|
|
102
|
+
© 2016 appPlant GmbH
|
|
103
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require 'bundler/setup'
|
|
4
|
+
require 'hidemyass'
|
|
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
data/exe/hidemyass
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
|
|
2
|
+
module HideMyAss
|
|
3
|
+
# Interface for the attributes of each proxy. Such attributes
|
|
4
|
+
# include the ip, port and protocol.
|
|
5
|
+
#
|
|
6
|
+
# @example Get the proxy's ip address.
|
|
7
|
+
# proxy.ip
|
|
8
|
+
# # => '178.22.148.122'
|
|
9
|
+
#
|
|
10
|
+
# @example Get the proxy's port.
|
|
11
|
+
# proxy.port
|
|
12
|
+
# # => 3129
|
|
13
|
+
#
|
|
14
|
+
# @example Get the proxy's protocol.
|
|
15
|
+
# proxy.protocol
|
|
16
|
+
# # => 'HTTPS'
|
|
17
|
+
#
|
|
18
|
+
# @example Get the hosted country.
|
|
19
|
+
# proxy.country
|
|
20
|
+
# # => 'FRANCE'
|
|
21
|
+
#
|
|
22
|
+
# @example Get the complete url.
|
|
23
|
+
# proxy.url
|
|
24
|
+
# # => 'https://178.22.148.122:3129'
|
|
25
|
+
class Proxy
|
|
26
|
+
# Initializes the proxy instance by passing a single row of the fetched
|
|
27
|
+
# result list. All attribute readers are lazy implemented.
|
|
28
|
+
#
|
|
29
|
+
# @param [ Nokogiri::XML ] row Pre-parsed row element.
|
|
30
|
+
#
|
|
31
|
+
# @return [ HideMyAss::Proxy ]
|
|
32
|
+
def initialize(row)
|
|
33
|
+
@row = row
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Time in seconds when the last ping was made.
|
|
37
|
+
#
|
|
38
|
+
# @return [ Int ]
|
|
39
|
+
def last_updated
|
|
40
|
+
@last_updated ||= begin
|
|
41
|
+
@row.at_xpath('td[1]').text.strip.split(' ').map do |it|
|
|
42
|
+
case it
|
|
43
|
+
when /sec/ then it.scan(/\d+/)[0].to_i
|
|
44
|
+
when /min/ then it.scan(/\d+/)[0].to_i * 60
|
|
45
|
+
when /h/ then it.scan(/\d+/)[0].to_i * 3_600
|
|
46
|
+
when /d/ then it.scan(/\d+/)[0].to_i * 86_400
|
|
47
|
+
end
|
|
48
|
+
end.reduce(&:+)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
alias last_test last_updated
|
|
53
|
+
|
|
54
|
+
# The IP of the proxy server.
|
|
55
|
+
#
|
|
56
|
+
# @return [ String ]
|
|
57
|
+
def ip
|
|
58
|
+
@ip ||= @row.at_xpath('td[2]/span').children
|
|
59
|
+
.select { |el| ip_block? el }
|
|
60
|
+
.map! { |el| el.text.strip }
|
|
61
|
+
.join('')
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# The port for the proxy.
|
|
65
|
+
#
|
|
66
|
+
# @return [ Int ]
|
|
67
|
+
def port
|
|
68
|
+
@port ||= @row.at_xpath('td[3]').text.strip.to_i
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# The country where the proxy is hosted.
|
|
72
|
+
#
|
|
73
|
+
# @return [ String ]
|
|
74
|
+
def country
|
|
75
|
+
@country ||= @row.at_xpath('td[4]').text.strip
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# The average response time in milliseconds.
|
|
79
|
+
#
|
|
80
|
+
# @return [ Int ]
|
|
81
|
+
def speed
|
|
82
|
+
@speed ||= @row.at_xpath('td[5]/div')[:value].to_i
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
alias response_time speed
|
|
86
|
+
|
|
87
|
+
# The average connection time in milliseconds.
|
|
88
|
+
#
|
|
89
|
+
# @return [ Int ]
|
|
90
|
+
def connection_time
|
|
91
|
+
@connection_time ||= @row.at_xpath('td[6]/div')[:value].to_i
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# The network protocol in in downcase letters.
|
|
95
|
+
# (https or http or socks4/5).
|
|
96
|
+
#
|
|
97
|
+
# @return [ String ]
|
|
98
|
+
def type
|
|
99
|
+
@type ||= @row.at_xpath('td[7]').text.strip.downcase[0..4]
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
alias protocol type
|
|
103
|
+
|
|
104
|
+
# The level of anonymity (Low, Medium, High, ...).
|
|
105
|
+
#
|
|
106
|
+
# @return [ String ]
|
|
107
|
+
def anonymity
|
|
108
|
+
@anonymity ||= @row.at_xpath('td[8]').text.strip
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# The complete URL of that proxy server.
|
|
112
|
+
#
|
|
113
|
+
# @return [ String ]
|
|
114
|
+
def url
|
|
115
|
+
"#{protocol}://#{ip}:#{port}"
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# If the IP is valid.
|
|
119
|
+
#
|
|
120
|
+
# @return [ Boolean ]
|
|
121
|
+
def valid?
|
|
122
|
+
ip.split('.').reject(&:empty?).count == 4
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# If the proxy's network protocol is HTTPS.
|
|
126
|
+
#
|
|
127
|
+
# @return [ Boolean ]
|
|
128
|
+
def https?
|
|
129
|
+
protocol == 'https'
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# If the proxy's network protocol is SOCKS.
|
|
133
|
+
#
|
|
134
|
+
# @return [ Boolean ]
|
|
135
|
+
def socks?
|
|
136
|
+
protocol.start_with? 'socks'
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# If the proxy supports SSL encryption.
|
|
140
|
+
#
|
|
141
|
+
# @return [ Boolean ]
|
|
142
|
+
def ssl?
|
|
143
|
+
https? || socks?
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# If the proxy's anonymity is high or even higher.
|
|
147
|
+
#
|
|
148
|
+
# @return [ Boolean ]
|
|
149
|
+
def anonym?
|
|
150
|
+
anonymity.start_with? 'high'
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# If the proxy's anonymity is at least high and protocol is encrypted.
|
|
154
|
+
#
|
|
155
|
+
# @return [ Boolean ]
|
|
156
|
+
def secure?
|
|
157
|
+
anonym? && ssl?
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
private
|
|
161
|
+
|
|
162
|
+
# To find out if the element is a part of the IP.
|
|
163
|
+
#
|
|
164
|
+
# @param [ Nokogiri::XML ] el
|
|
165
|
+
#
|
|
166
|
+
# @return [ Boolean ]
|
|
167
|
+
def ip_block?(el)
|
|
168
|
+
return el[:style].include? 'in' if el[:style]
|
|
169
|
+
|
|
170
|
+
@clss ||= @row.at_xpath('td[2]/span/style').text.split
|
|
171
|
+
.map! { |it| it[1..4] if it !~ /none/ }.compact
|
|
172
|
+
|
|
173
|
+
cls = el[:class].to_s
|
|
174
|
+
|
|
175
|
+
el.name == 'text' || @clss.include?(cls) || cls =~ /^\d+$/
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
require 'forwardable'
|
|
2
|
+
require 'open-uri'
|
|
3
|
+
require 'net/http'
|
|
4
|
+
require 'nokogiri'
|
|
5
|
+
require 'hidemyass/proxy'
|
|
6
|
+
|
|
7
|
+
module HideMyAss
|
|
8
|
+
# Represent a list of proxies that match the specified search properties.
|
|
9
|
+
#
|
|
10
|
+
# @example Iterate over all proxy server hosted in the US.
|
|
11
|
+
# ProxyList.new('c[]' => 'Europe').each { |proxy| ... }
|
|
12
|
+
#
|
|
13
|
+
# @example List of all proxy server URLs
|
|
14
|
+
# ProxyList.new.map(&:url)
|
|
15
|
+
# # => ['https://178.22.148.122:3129']
|
|
16
|
+
class ProxyList
|
|
17
|
+
include Enumerable
|
|
18
|
+
extend Forwardable
|
|
19
|
+
|
|
20
|
+
ENDPOINT = 'http://proxylist.hidemyass.com'.freeze
|
|
21
|
+
|
|
22
|
+
private_constant :ENDPOINT
|
|
23
|
+
|
|
24
|
+
# Represent a list of proxies that match the specified search properties.
|
|
25
|
+
#
|
|
26
|
+
# @param [ Hash ] form_data See HideMyAss.form_data for more info.
|
|
27
|
+
#
|
|
28
|
+
# @return [ HideMyAss::ProxyList ]
|
|
29
|
+
def initialize(form_data = HideMyAss.form_data)
|
|
30
|
+
self.form_data = form_data.dup
|
|
31
|
+
@proxies = fetch.keep_if(&:valid?)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Form data to support custom searches
|
|
35
|
+
attr_accessor :form_data
|
|
36
|
+
|
|
37
|
+
def_delegator :@proxies, :each
|
|
38
|
+
|
|
39
|
+
private
|
|
40
|
+
|
|
41
|
+
# Fetch list of all proxies.
|
|
42
|
+
#
|
|
43
|
+
# @return [ Array<HideMyAss::Proxy> ]
|
|
44
|
+
def fetch(url = ENDPOINT)
|
|
45
|
+
res = Net::HTTP.post_form(URI(url), form_data)
|
|
46
|
+
page = Nokogiri::HTML(res.body, nil, 'UTF-8')
|
|
47
|
+
sel_row = '//table[@id="listable"]/tbody/tr'
|
|
48
|
+
sel_lnk = 'section > section.section-component > section.hma-pagination li.arrow.next:not(.unavailable) > a' # rubocop:disable Metrics/LineLength
|
|
49
|
+
|
|
50
|
+
proxies = page.xpath(sel_row).map { |row| Proxy.new(row) }
|
|
51
|
+
link = page.at_css(sel_lnk)
|
|
52
|
+
|
|
53
|
+
link ? proxies.concat(fetch("#{ENDPOINT}#{link[:href]}")) : proxies
|
|
54
|
+
rescue Timeout::Error
|
|
55
|
+
[]
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
data/lib/hidemyass.rb
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
require 'hidemyass/proxy_list'
|
|
2
|
+
require 'hidemyass/version'
|
|
3
|
+
|
|
4
|
+
# Hide My Ass! fetches proxies at www.hidemyass.com
|
|
5
|
+
#
|
|
6
|
+
# @example Ask for proxies multiple times
|
|
7
|
+
# but retrieve the list just a single time.
|
|
8
|
+
#
|
|
9
|
+
# HideMyAss.proxies
|
|
10
|
+
# # => HideMyAss::ProxyList
|
|
11
|
+
#
|
|
12
|
+
# @example Fetch the list with each call.
|
|
13
|
+
#
|
|
14
|
+
# HideMyAss.proxies!
|
|
15
|
+
# # => HideMyAss::ProxyList
|
|
16
|
+
#
|
|
17
|
+
# @example Limit proxies to only available in Europe.
|
|
18
|
+
#
|
|
19
|
+
# HideMyAss.proxies 'c[]' => 'Europe'
|
|
20
|
+
# # => HideMyAss::ProxyList
|
|
21
|
+
#
|
|
22
|
+
module HideMyAss
|
|
23
|
+
# List of proxies found at hidemyass.com.
|
|
24
|
+
#
|
|
25
|
+
# @example Fetch the list with each call.
|
|
26
|
+
# HideMyAss.proxies!
|
|
27
|
+
# # => HideMyAss::ProxyList
|
|
28
|
+
#
|
|
29
|
+
# @example Limit proxies to only available in Europe.
|
|
30
|
+
# HideMyAss.proxies 'c[]' => 'Europe'
|
|
31
|
+
# # => HideMyAss::ProxyList
|
|
32
|
+
#
|
|
33
|
+
# @param [ Hash ] data Optional form data for custom searches.
|
|
34
|
+
#
|
|
35
|
+
# @return [ HideMyAss::ProxyList> ]
|
|
36
|
+
def self.proxies(data = nil)
|
|
37
|
+
@proxies = nil
|
|
38
|
+
proxies!(data)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# List of proxies found at hidemyass.com but returns former search result
|
|
42
|
+
# if available.
|
|
43
|
+
#
|
|
44
|
+
# @example Fetch the list with each call.
|
|
45
|
+
# HideMyAss.proxies!
|
|
46
|
+
# # => HideMyAss::ProxyList
|
|
47
|
+
#
|
|
48
|
+
# @example Limit proxies to only available in Europe.
|
|
49
|
+
# HideMyAss.proxies 'c[]' => 'Europe'
|
|
50
|
+
# # => HideMyAss::ProxyList
|
|
51
|
+
#
|
|
52
|
+
# @param [ Hash ] data Optional form data for custom searches.
|
|
53
|
+
#
|
|
54
|
+
# @return [ HideMyAss::ProxyList> ]
|
|
55
|
+
def self.proxies!(data = nil)
|
|
56
|
+
self.form_data = data if data
|
|
57
|
+
@proxies ||= ProxyList.new(form_data)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Set form data to support custom searches.
|
|
61
|
+
#
|
|
62
|
+
# @param [ Hash ] data See form_data for more info.
|
|
63
|
+
#
|
|
64
|
+
# @return [ Void ]
|
|
65
|
+
def self.form_data=(data)
|
|
66
|
+
raise ArgumentError, 'form data has to be a hash' unless data.is_a? Hash
|
|
67
|
+
@form_data = data
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Get form data for custom search.
|
|
71
|
+
#
|
|
72
|
+
# c[] - Countries
|
|
73
|
+
# p - Port. Defaults to all ports.
|
|
74
|
+
# pr[] - Protocol. 0..2 = HTTP, HTTPS, socks4/5
|
|
75
|
+
# a[] - Anonymity level. 0..4 = None, Low, Medium, High, High +KA
|
|
76
|
+
# sp[] - Speed. 0..2 = Slow, Medium, Fast.
|
|
77
|
+
# ct[] - Connection time. 0..2 = Slow, Medium, Fast
|
|
78
|
+
# s - Sort. 0..3 = Response time, Connection time, Country A-Z.
|
|
79
|
+
# o - Order. 0, 1 = DESC, ASC.
|
|
80
|
+
# pp - Per Page. 0..3 = 10, 25, 50, 100.
|
|
81
|
+
# sortBy - Sort by. Defaults to date.
|
|
82
|
+
#
|
|
83
|
+
# @return [ Hash ]
|
|
84
|
+
def self.form_data
|
|
85
|
+
@form_data ||= { 'c[]' => nil,
|
|
86
|
+
'p' => nil,
|
|
87
|
+
'pr[]' => [0, 1],
|
|
88
|
+
'a[]' => [3, 4],
|
|
89
|
+
'sp[]' => [1, 2, 3],
|
|
90
|
+
'ct[]' => [1, 2, 3],
|
|
91
|
+
's' => 1,
|
|
92
|
+
'o' => 0,
|
|
93
|
+
'pp' => 3,
|
|
94
|
+
'sortBy' => 'response_time' }
|
|
95
|
+
end
|
|
96
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: hidemyass2
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Sebastián Katzer
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2016-07-08 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.11'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.11'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '11.1'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '11.1'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rspec
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '3.5'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '3.5'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: webmock
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '2.0'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '2.0'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: simplecov
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: codeclimate-test-reporter
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: pry-nav
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: nokogiri
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - "~>"
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '1.6'
|
|
118
|
+
type: :runtime
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - "~>"
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '1.6'
|
|
125
|
+
description: Allows everyone to surf privately from anywhere.
|
|
126
|
+
email:
|
|
127
|
+
- katzer@appplant.de
|
|
128
|
+
executables:
|
|
129
|
+
- hidemyass
|
|
130
|
+
extensions: []
|
|
131
|
+
extra_rdoc_files: []
|
|
132
|
+
files:
|
|
133
|
+
- ".gitignore"
|
|
134
|
+
- ".travis.yml"
|
|
135
|
+
- Gemfile
|
|
136
|
+
- LICENSE
|
|
137
|
+
- README.md
|
|
138
|
+
- Rakefile
|
|
139
|
+
- bin/console
|
|
140
|
+
- bin/setup
|
|
141
|
+
- exe/hidemyass
|
|
142
|
+
- lib/hidemyass.rb
|
|
143
|
+
- lib/hidemyass/proxy.rb
|
|
144
|
+
- lib/hidemyass/proxy_list.rb
|
|
145
|
+
- lib/hidemyass/version.rb
|
|
146
|
+
homepage: https://github.com/appPlant/hidemyass2
|
|
147
|
+
licenses:
|
|
148
|
+
- MIT
|
|
149
|
+
metadata: {}
|
|
150
|
+
post_install_message:
|
|
151
|
+
rdoc_options: []
|
|
152
|
+
require_paths:
|
|
153
|
+
- lib
|
|
154
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
|
+
requirements:
|
|
156
|
+
- - ">="
|
|
157
|
+
- !ruby/object:Gem::Version
|
|
158
|
+
version: '0'
|
|
159
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
|
+
requirements:
|
|
161
|
+
- - ">="
|
|
162
|
+
- !ruby/object:Gem::Version
|
|
163
|
+
version: '0'
|
|
164
|
+
requirements: []
|
|
165
|
+
rubyforge_project:
|
|
166
|
+
rubygems_version: 2.5.2
|
|
167
|
+
signing_key:
|
|
168
|
+
specification_version: 4
|
|
169
|
+
summary: Hide My Ass! /2 fetches proxies at www.hidemyass.com.
|
|
170
|
+
test_files: []
|