maygion-ipcam 0.1.6 → 0.1.7

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ea6717e76ed2658b25fb15d56c421244817768bc
4
+ data.tar.gz: da5458fd2bc8cf0f55df764d3e56c26516eb8e23
5
+ SHA512:
6
+ metadata.gz: 27477d8859fd29d7c11d01f5685916a010f80e286f6da68a11dbef13adb4fc27bcf8183a504b4bd2ac625f450170335c3b927788d8680684e2b7bdc2a9f53b4b
7
+ data.tar.gz: b747229678f33a61501212edf69c105dc4fff7eb874578aef0153b9202c6a0cd0e8d50d9e2a67030ca8f87fb346d6f5e7e434ddf45aa7a8a63d9e259873f8de8
checksums.yaml.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ #+M�\���m�N���!p-  ��ġG�'��KV��΄��Y���}�Gg�Z �!���;�\� ^
2
+ �t<���쮏��'�:mϷT�iϗ��ڬ��AT^�^��.��C#|��!c �Q@v�H'� �^=h(���8��/"��vnԛ�9��&s��&T�1^���::�����z�*�q�G+���@�-�ØP��
data/lib/maygion-ipcam.rb CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/ruby
1
+ #!/usr/bin/env ruby
2
2
 
3
3
  # file: maygion-ipcam.rb
4
4
 
@@ -12,9 +12,11 @@ class MayGionIPCam
12
12
 
13
13
  def initialize(opt)
14
14
 
15
- o = {username: 'user', password: 'user', address: '192.168.1.14', port: 80, cookie: ''}.merge(opt)
15
+ o = {username: 'user', password: 'user', address: '192.168.1.14', \
16
+ port: 80, cookie: ''}.merge(opt)
16
17
  @addr, @port = o[:address], o[:port]
17
- @raw_url = "http://#{@addr}/cgi.cmd?cmd=moveptz&user=user&pwd=user"
18
+ @raw_url = "http://#{@addr}/cgi.cmd?cmd=moveptz&user=" + o[:username] \
19
+ + "&pwd=" + o[:password]
18
20
  @cookie = o[:cookie]
19
21
 
20
22
  if @cookie.empty? then
@@ -45,7 +47,8 @@ class MayGionIPCam
45
47
  path = '/cgi-bin/cgicmd'
46
48
 
47
49
  # POST request -> logging in
48
- data = 'szAccount=user&szPassword=user&cmd=Login&urlOnSuccess=/mobile.asp'
50
+ data = "szAccount=#{username}&szPassword=" + password +
51
+ "&cmd=Login&urlOnSuccess=/mobile.asp"
49
52
  headers = {
50
53
  'Referer' => "http://#{@addr}/login.asp",
51
54
  'Content-Type' => 'application/x-www-form-urlencoded'
@@ -56,6 +59,7 @@ class MayGionIPCam
56
59
 
57
60
  def move_camera(instruction)
58
61
  url = @raw_url + instruction
59
- open(url, 'UserAgent' => 'Ruby IPCO (IP Camera Operator)', 'Cookie' => @cookie).read
62
+ open(url, 'UserAgent' => 'Ruby IPCO (IP Camera Operator)', \
63
+ 'Cookie' => @cookie){|x| x.read}
60
64
  end
61
65
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,14 +1,13 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: maygion-ipcam
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.1.6
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.7
6
5
  platform: ruby
7
- authors:
6
+ authors:
8
7
  - James Robertson
9
8
  autorequire:
10
9
  bindir: bin
11
- cert_chain:
10
+ cert_chain:
12
11
  - |
13
12
  -----BEGIN CERTIFICATE-----
14
13
  MIIDRDCCAiygAwIBAgIBADANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
@@ -30,46 +29,36 @@ cert_chain:
30
29
  SF7nTxCH4tpHwwKBtHZkbPdWU3z7wpH4rmvwSLfP5gEFKvgPQr5X/muijiHNT95n
31
30
  AzP3SN3XDI0vnKlZt6kdC2WpEzolN2FO
32
31
  -----END CERTIFICATE-----
33
-
34
- date: 2013-02-06 00:00:00 Z
32
+ date: 2013-05-22 00:00:00.000000000 Z
35
33
  dependencies: []
36
-
37
34
  description:
38
35
  email:
39
36
  executables: []
40
-
41
37
  extensions: []
42
-
43
38
  extra_rdoc_files: []
44
-
45
- files:
39
+ files:
46
40
  - lib/maygion-ipcam.rb
47
41
  homepage:
48
42
  licenses: []
49
-
43
+ metadata: {}
50
44
  post_install_message:
51
45
  rdoc_options: []
52
-
53
- require_paths:
46
+ require_paths:
54
47
  - lib
55
- required_ruby_version: !ruby/object:Gem::Requirement
56
- none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- version: "0"
61
- required_rubygems_version: !ruby/object:Gem::Requirement
62
- none: false
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: "0"
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
67
58
  requirements: []
68
-
69
59
  rubyforge_project:
70
- rubygems_version: 1.8.23
60
+ rubygems_version: 2.0.0.rc.2
71
61
  signing_key:
72
- specification_version: 3
62
+ specification_version: 4
73
63
  summary: maygion-ipcam
74
64
  test_files: []
75
-
metadata.gz.sig CHANGED
Binary file