proxynova 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2ac7b5c3c0835b364d36eca083c61a840d361d0d
4
+ data.tar.gz: c9fdd821499028cbe8aecbbf09af7f3ec2f90a90
5
+ SHA512:
6
+ metadata.gz: 2a1bd9478f92f0632a16e4b26c30f3b70a519dcfbd0fd5880cbe56902e382ecdf4cb0abbf2184ba671d2b1e39b4fd958c25f64f5881f873681b777639b766ee3
7
+ data.tar.gz: bf3536f4323ad8251b3a12faf2e50dbcf56473b860e2e8bf24289268a68c107feacb0714d8716dfb3b628f5234a99c9df13f620c26cdccef01dd523d7123f9cc
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in proxynova.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Alfred Rowe
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,70 @@
1
+ # Proxynova
2
+
3
+ Simple library to retrieve public IPs, PORT and other details such as speed, uptime, anonymity level, last check etc. Proxinova also comes with a commandline utility. This library relys on the [Proxynova Website](http://www.proxynova.com/) to function properly.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'proxynova'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install proxynova
20
+
21
+ ## Usage in your code
22
+ Calling `Proxynova.get_list` method returns an array containing hashes of proxy address details as shown in the example below
23
+
24
+ ```ruby
25
+ require 'proxynova'
26
+ proxies = Proxynova.get_list
27
+ puts proxies
28
+ ```
29
+
30
+ ##### Result
31
+ ```ruby
32
+ {:ip=>"173.218.180.170", :port=>"8080", :last_check=>"2015-03-21 18:36:30Z", :speed=>100.0, :uptime=>"100%", :country=>"United States - Tyler", :anonymity=>"Transparent"}
33
+ {:ip=>"167.114.144.14", :port=>"3128", :last_check=>"2015-03-21 18:36:29Z", :speed=>100.0, :uptime=>"62%", :country=>"United States - Mcallen", :anonymity=>"Elite"}
34
+ {:ip=>"107.17.100.254", :port=>"8080", :last_check=>"2015-03-21 18:33:36Z", :speed=>100.0, :uptime=>"30%", :country=>"United States", :anonymity=>"Anonymous"}
35
+ {:ip=>"107.182.17.9", :port=>"7808", :last_check=>"2015-03-21 18:33:26Z", :speed=>100.0, :uptime=>"91%", :country=>"United States", :anonymity=>"Elite"}
36
+ {:ip=>"107.155.77.119", :port=>"7808", :last_check=>"2015-03-21 18:33:26Z", :speed=>100.0, :uptime=>"89%", :country=>"United States", :anonymity=>"Elite"}
37
+ {:ip=>"191.240.150.153", :port=>"8080", :last_check=>"2015-03-21 18:33:23Z", :speed=>21.44, :uptime=>"27%", :country=>"United States - Marina Del Rey", :anonymity=>"Transparent"}
38
+ ```
39
+
40
+ ## Commandline Usage
41
+ Proxynova comes with a simple commandline utlity `proxynova` for quick retrieval of public proxy details. By default calling `proxynova` without an argument will return proxy servers from the United States. If you wish to return proxy servers for example from Russia you need to provide the ISO 2-letter code as the argument.
42
+
43
+ ```
44
+ proxynova ru
45
+ ```
46
+
47
+ ##### Result
48
+ ```
49
+ IP ADDRESS PORT SPEED UPTIME LAST CHECK ANONYMITY LOCATION
50
+ 80.79.241.30 8080 38.86 21% 2015-03-21 18:32:05Z Transparent Russia - Saint Petersburg
51
+ 79.140.66.218 8080 22.98 37% 2015-03-21 18:31:59Z Transparent Russia
52
+ 109.60.249.107 3128 100.0 24% 2015-03-21 18:31:57Z Transparent Russia - Ivanovo
53
+ 80.252.155.139 8080 16.74 24% 2015-03-21 18:31:55Z Transparent Russia
54
+ 77.37.218.19 8080 26.6 33% 2015-03-21 18:31:25Z Transparent Russia - Moscow
55
+ 77.37.130.244 8080 40.74 31% 2015-03-21 18:31:23Z Elite Russia - Moscow
56
+ 62.176.27.228 3128 38.38 27% 2015-03-21 18:31:01Z Transparent Russia
57
+ 62.205.162.68 3128 69.6 23% 2015-03-21 18:31:00Z Transparent Russia
58
+ 195.114.125.81 8080 23.95 58% 2015-03-21 18:29:31Z Transparent Russia
59
+ 178.166.155.36 8080 27.19 25% 2015-03-21 18:29:14Z Transparent Russia - Krasnoyarsk
60
+ 213.79.96.90 8080 31.4 40% 2015-03-21 18:27:29Z Transparent Russia
61
+ 188.130.128.243 80 100.0 52% 2015-03-21 18:25:21Z Transparent Russia
62
+ ```
63
+
64
+ ## Contributing
65
+
66
+ 1. Fork it ( https://github.com/nukturnal/proxynova/fork )
67
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
68
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
69
+ 4. Push to the branch (`git push origin my-new-feature`)
70
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
3
+ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
4
+
5
+ require 'proxynova'
6
+
7
+ def help(s = "Usage: proxynova [COUNTRY_CODE]")
8
+ $stderr.puts(s)
9
+ end
10
+
11
+ # Lazy check of --help param
12
+ def process_argument(arg)
13
+ if arg
14
+ arg == '--help' ? help : get_ips(arg)
15
+ else
16
+ get_ips
17
+ end
18
+ exit(0)
19
+ end
20
+
21
+ def get_ips(country='us')
22
+ proxies = Proxynova.get_list(country)
23
+ $stderr.puts "IP ADDRESS\tPORT\tSPEED\tUPTIME\tLAST CHECK\t\tANONYMITY\tLOCATION"
24
+ proxies.each do |proxy|
25
+ $stderr.puts "#{proxy[:ip]}\t#{proxy[:port]}\t#{proxy[:speed]}\t#{proxy[:uptime]}\t#{proxy[:last_check]}\t#{proxy[:anonymity]}\t#{proxy[:country]}"
26
+ end
27
+ end
28
+ process_argument(ARGV[0])
@@ -0,0 +1,47 @@
1
+ require "proxynova/version"
2
+ require 'nokogiri'
3
+ require 'open-uri'
4
+
5
+ module Proxynova
6
+ BASE_URL = 'http://www.proxynova.com/proxy-server-list/country-'
7
+ DEFAULT_COUNTRY = 'US'
8
+ DEFAULT_URL = BASE_URL+DEFAULT_COUNTRY.downcase
9
+
10
+ # Default Proxy IP List country is US
11
+ # This is simply an appending of the URL based on the currently url structure of proxynova.com
12
+ def self.get_list(country = DEFAULT_COUNTRY)
13
+ proxies = []
14
+ base_url = country.nil? ? DEFAULT_URL : BASE_URL+country.downcase
15
+ page = Nokogiri::HTML(open(base_url))
16
+ proxy_table = page.search('#tbl_proxy_list tr')
17
+ proxy_table.each do |row|
18
+ data = row.search('td')
19
+ if data.count >= 7
20
+ proxies << {
21
+ ip: clean(data[0].text.strip),
22
+ port: clean(data[1].text.strip),
23
+ last_check: clean(data[2].search('.timeago').attr('datetime').text.strip),
24
+ speed: data[3].search('.progress-bar').attr('data-value').text.strip.to_f.round(2),
25
+ uptime: clean(data[4].text.strip),
26
+ country: clean(data[5].text.strip),
27
+ anonymity: clean(data[6].text.strip)
28
+ }
29
+ end
30
+ end
31
+ proxies
32
+ end
33
+
34
+ def self.print
35
+ proxies = get_list
36
+ puts "IP ADDRESS\tPORT\tSPEED\tUPTIME\tLAST CHECK\t\tANONYMITY\tLOCATION"
37
+ proxies.each do |proxy|
38
+ puts "#{proxy[:ip]}\t#{proxy[:port]}\t#{proxy[:speed]}\t#{proxy[:uptime]}\t#{proxy[:last_check]}\t#{proxy[:anonymity]}\t#{proxy[:country]}"
39
+ end
40
+ end
41
+
42
+ private
43
+ # Quick Cleanup of string
44
+ def self.clean(str)
45
+ str.gsub(/[^[:print:]]/,'').split.join(' ')
46
+ end
47
+ end
@@ -0,0 +1,3 @@
1
+ module Proxynova
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'proxynova/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "proxynova"
8
+ spec.version = Proxynova::VERSION
9
+ spec.authors = ["Alfred Rowe"]
10
+ spec.email = ["alfred@encodevlabs.com"]
11
+ spec.summary = %q{Public Proxy IPs List}
12
+ spec.description = %q{Simple library to retrieve public IPs, PORT and other details such as speed, uptime, anonymity level, last check etc. Proxinova also comes with a commandline utility}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "nokogiri", "~> 1.5.11"
24
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: proxynova
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Alfred Rowe
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-21 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.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
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: 1.5.11
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.5.11
55
+ description: Simple library to retrieve public IPs, PORT and other details such as
56
+ speed, uptime, anonymity level, last check etc. Proxinova also comes with a commandline
57
+ utility
58
+ email:
59
+ - alfred@encodevlabs.com
60
+ executables:
61
+ - proxynova
62
+ extensions: []
63
+ extra_rdoc_files: []
64
+ files:
65
+ - ".gitignore"
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - bin/proxynova
71
+ - lib/proxynova.rb
72
+ - lib/proxynova/version.rb
73
+ - proxynova.gemspec
74
+ homepage: ''
75
+ licenses:
76
+ - MIT
77
+ metadata: {}
78
+ post_install_message:
79
+ rdoc_options: []
80
+ require_paths:
81
+ - lib
82
+ required_ruby_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ requirements: []
93
+ rubyforge_project:
94
+ rubygems_version: 2.4.5
95
+ signing_key:
96
+ specification_version: 4
97
+ summary: Public Proxy IPs List
98
+ test_files: []