lwqzx 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 706efe2eb2b1161c2d698186961d6455552afb18
4
- data.tar.gz: 8c6f215f0b657f17471de7abae8aa6b0c02e4a2b
3
+ metadata.gz: 80d7e8ff407cabebc76dfd550d0c2e6d17952eaa
4
+ data.tar.gz: df68bbbdb34ee52f6ecf28f19418ab8b3817eb07
5
5
  SHA512:
6
- metadata.gz: 3946306ff2612d1a438064671ba8130f99f902182b7fe4f962164293a203846a4ef6bcb5df5e35b0f1b58ec0ab0eccbd407af3aeda622e5176d547be6d67aced
7
- data.tar.gz: bb7280819f7ddf21f1d4a2f4ab4da47eeae6c9854811e5d7a08a7b1944b3946216e3db7705f60c8af515b733269afea57f4faf664f217834b73d8a72bb692ca0
6
+ metadata.gz: 13ec5296d87cb745bab1d9b8321462d812a8a2d224b757b69e43910468826cd5b78a9e48e713e4bc3d6151ba049aa57dc8a884bb91d7d000aa74795803049568
7
+ data.tar.gz: b805b7183e2dfefb60cb7697535bfd20115f308a9468ff7ce3e413e0eee61103f4defe26d5ca974818854347fe2a74ce2fdc44abee21a51224198566d7df8b77
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ .gem
1
2
  /.bundle/
2
3
  /.yardoc
3
4
  /Gemfile.lock
data/lib/lwqzx/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lwqzx
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/lwqzx.rb CHANGED
@@ -9,15 +9,14 @@ module Lwqzx
9
9
  res = %x[curl #{lurl} -s -c /tmp/cookies -d #{user} -d #{psd} ]
10
10
  aurl = "http://www.lwqzx.sdedu.net/kernel/net_school/islogin.php"
11
11
  ares = %x[curl -s -b /tmp/cookies #{aurl}]
12
- return {} if ares.to_s == "0"
12
+ return {} if ares.to_s == "0"
13
13
  infos = %x[curl -s -b /tmp/cookies #{lurl}]
14
14
  content=infos.encode("UTF-8","GB2312")
15
15
  doc = Nokogiri::HTML(content)
16
- user = doc.at("span.web1")
16
+ uname = doc.css("span.tt1 a:nth-child(1)").text
17
+ groups = doc.css("span.tt1 a:nth-child(5)")[0]["title"]
17
18
  %x[rm /tmp/cookies]
18
- uinfos = user.text.gsub!(/\n+|\r+/, "").strip!.split(" ")
19
- uname = uinfos[1].split(":")[1]
20
- groups= uinfos[3].split(":")[1].gsub("[","").gsub("]","").split("@").compact.reject(&:empty?)
19
+ groups=groups.gsub("[","").gsub("]","").split("@").compact.reject(&:empty?)
21
20
  return {login: login, name: uname, groups: groups}
22
- end
21
+ end
23
22
  end
data/lwqzx-0.0.3.gem ADDED
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lwqzx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - zxy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-18 00:00:00.000000000 Z
11
+ date: 2017-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,6 +67,7 @@ files:
67
67
  - bin/setup
68
68
  - lib/lwqzx.rb
69
69
  - lib/lwqzx/version.rb
70
+ - lwqzx-0.0.3.gem
70
71
  - lwqzx.gemspec
71
72
  homepage: ''
72
73
  licenses: []
@@ -87,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
88
  version: '0'
88
89
  requirements: []
89
90
  rubyforge_project:
90
- rubygems_version: 2.6.2
91
+ rubygems_version: 2.6.4
91
92
  signing_key:
92
93
  specification_version: 4
93
94
  summary: lwqzx infos