hotspot-login 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/hl.rb +3 -3
- data/lib/hl.rb +10 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06e51e32b4c2fdf94fd714d41a182a5cd4cd6dbf
|
4
|
+
data.tar.gz: 80aad1033c0c7c7a99ef09c3d431b4e94dba1a83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72e5111b8d1b7729acd2bde0a463dbe7b0346ec45db8807c352c1900961a0b971111e1295b5a188de494ac916692e787efeaf2bed255679b92c07a856458d449
|
7
|
+
data.tar.gz: d56ac9a6f2d35354975ee9a734106c104b7fee1581d6092efe0e666d1b713aaf024a136877d933a6f595ba9d2be1e82d6db844d2d6ffd5f2f6af2963a11068c3
|
data/bin/hl.rb
CHANGED
@@ -57,9 +57,9 @@ class Hotspot_Login
|
|
57
57
|
if not File.exists? path
|
58
58
|
open(path, 'w') do |f|
|
59
59
|
f.puts "# profile:\n"
|
60
|
-
f.puts "# hotspot: sfr or free or uppa\n"
|
61
|
-
f.puts "# user:\n"
|
62
|
-
f.puts "# password:\n"
|
60
|
+
f.puts "# :hotspot: sfr or free or uppa\n"
|
61
|
+
f.puts "# :user:\n"
|
62
|
+
f.puts "# :password:\n"
|
63
63
|
f.puts "profile: null:\n"
|
64
64
|
end
|
65
65
|
end
|
data/lib/hl.rb
CHANGED
@@ -4,27 +4,30 @@ require 'cgi'
|
|
4
4
|
module Hotspot
|
5
5
|
class Hotspot
|
6
6
|
def initialize(user, password)
|
7
|
-
@uri_test =
|
7
|
+
@uri_test = "http://www.example.com"
|
8
8
|
@user = user
|
9
9
|
@password = password
|
10
10
|
login_url
|
11
11
|
end
|
12
12
|
|
13
|
+
# Check connection to internet
|
13
14
|
def connect?
|
14
|
-
redirect = redirect?
|
15
|
+
redirect = redirect? get(@uri_test)
|
15
16
|
redirect == @uri_test.to_s
|
16
17
|
end
|
17
18
|
|
19
|
+
# Get the url of login hotspot
|
18
20
|
def login_url
|
19
21
|
login_url! if @login_url.nil?
|
20
22
|
@login_url
|
21
23
|
end
|
22
24
|
|
25
|
+
# Force login_url
|
23
26
|
def login_url!
|
24
|
-
@login_url = redirect?
|
27
|
+
@login_url = redirect? get(@uri_test)
|
25
28
|
end
|
26
29
|
|
27
|
-
|
30
|
+
# Get the the forwarding url
|
28
31
|
def redirect?(res)
|
29
32
|
case res
|
30
33
|
when Net::HTTPSuccess then
|
@@ -41,10 +44,12 @@ class Hotspot
|
|
41
44
|
end
|
42
45
|
end
|
43
46
|
|
47
|
+
# Return login url
|
44
48
|
def info
|
45
49
|
URI.parse(login_url)
|
46
50
|
end
|
47
51
|
|
52
|
+
# Return params of login url
|
48
53
|
def params
|
49
54
|
if not info.query.nil?
|
50
55
|
CGI::parse(info.query)
|
@@ -53,6 +58,7 @@ class Hotspot
|
|
53
58
|
end
|
54
59
|
end
|
55
60
|
|
61
|
+
# Return uri test to test connect
|
56
62
|
def uri_test
|
57
63
|
@uri_test
|
58
64
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotspot-login
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrien Jeser
|
@@ -10,7 +10,8 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2013-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Hotspot
|
13
|
+
description: Hotspot-login is a ruby script. It goal is connected hotspot like "Sfr
|
14
|
+
Wifi", "FreeWifi" and "UPPA"
|
14
15
|
email: adrien@jeser.me
|
15
16
|
executables:
|
16
17
|
- hl.rb
|