foscam-ruby 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/Guardfile +10 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/foscam-ruby.gemspec +34 -0
- data/lib/foscam-ruby.rb +8 -0
- data/lib/foscam/client.rb +425 -0
- data/lib/foscam/version.rb +3 -0
- data/spec/fixtures/vcr/foscam_camera_control_brightness.yml +42 -0
- data/spec/fixtures/vcr/foscam_camera_control_contrast.yml +42 -0
- data/spec/fixtures/vcr/foscam_camera_control_mode.yml +42 -0
- data/spec/fixtures/vcr/foscam_camera_control_orientation.yml +42 -0
- data/spec/fixtures/vcr/foscam_camera_control_resolution.yml +42 -0
- data/spec/fixtures/vcr/foscam_comm_write.yml +42 -0
- data/spec/fixtures/vcr/foscam_decoder_control.yml +42 -0
- data/spec/fixtures/vcr/foscam_get_camera_params.yml +52 -0
- data/spec/fixtures/vcr/foscam_get_forbidden.yml +84 -0
- data/spec/fixtures/vcr/foscam_get_misc.yml +66 -0
- data/spec/fixtures/vcr/foscam_get_params.yml +428 -0
- data/spec/fixtures/vcr/foscam_get_status.yml +68 -0
- data/spec/fixtures/vcr/foscam_reboot.yml +42 -0
- data/spec/fixtures/vcr/foscam_restore_factory.yml +42 -0
- data/spec/fixtures/vcr/foscam_set_alarm.yml +42 -0
- data/spec/fixtures/vcr/foscam_set_alias.yml +42 -0
- data/spec/fixtures/vcr/foscam_set_datetime.yml +42 -0
- data/spec/fixtures/vcr/foscam_set_ddns.yml +40 -0
- data/spec/fixtures/vcr/foscam_set_decoder.yml +42 -0
- data/spec/fixtures/vcr/foscam_set_forbidden.yml +40 -0
- data/spec/fixtures/vcr/foscam_set_ftp.yml +42 -0
- data/spec/fixtures/vcr/foscam_set_mail.yml +40 -0
- data/spec/fixtures/vcr/foscam_set_misc.yml +105 -0
- data/spec/fixtures/vcr/foscam_set_network.yml +40 -0
- data/spec/fixtures/vcr/foscam_set_pppoe.yml +42 -0
- data/spec/fixtures/vcr/foscam_set_upnp.yml +42 -0
- data/spec/fixtures/vcr/foscam_set_user2.yml +40 -0
- data/spec/fixtures/vcr/foscam_set_user3.yml +40 -0
- data/spec/fixtures/vcr/foscam_set_user4.yml +40 -0
- data/spec/fixtures/vcr/foscam_set_user5.yml +40 -0
- data/spec/fixtures/vcr/foscam_set_user6.yml +40 -0
- data/spec/fixtures/vcr/foscam_set_user7.yml +40 -0
- data/spec/fixtures/vcr/foscam_set_user8.yml +40 -0
- data/spec/fixtures/vcr/foscam_set_wifi.yml +40 -0
- data/spec/fixtures/vcr/foscam_snapshot.yml +236 -0
- data/spec/fixtures/vcr/foscam_upgrade_firmware.yml +40 -0
- data/spec/fixtures/vcr/foscam_upgrade_htmls.yml +40 -0
- data/spec/foscam/client_spec.rb +1269 -0
- data/spec/spec_helper.rb +24 -0
- metadata +301 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/set_network.cgi?dns=8.8.8.8&gateway=0.0.0.0&ip=192.168.0.100&mask=0.0.0.0&port=8080
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
authorization:
|
11
|
+
- Basic Y3dhZGRpbmc6ZnY1MHhFZ0d3Ug==
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
accept:
|
15
|
+
- ! '*/*'
|
16
|
+
user-agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
server:
|
24
|
+
- Netwave IP Camera
|
25
|
+
date:
|
26
|
+
- Thu, 01 Jan 1970 01:31:35 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '22'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'error: illegal params.'
|
38
|
+
http_version: '1.1'
|
39
|
+
recorded_at: Wed, 12 Dec 2012 04:27:49 GMT
|
40
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/set_pppoe.cgi?enable=1&pwd=pass&user=root
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
authorization:
|
11
|
+
- Basic Y3dhZGRpbmc6ZnY1MHhFZ0d3Ug==
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
accept:
|
15
|
+
- ! '*/*'
|
16
|
+
user-agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
server:
|
24
|
+
- Netwave IP Camera
|
25
|
+
date:
|
26
|
+
- Thu, 13 Dec 2012 00:49:21 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '4'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'ok.
|
38
|
+
|
39
|
+
'
|
40
|
+
http_version: '1.1'
|
41
|
+
recorded_at: Thu, 13 Dec 2012 00:49:25 GMT
|
42
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/set_upnp.cgi?enable=1
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
authorization:
|
11
|
+
- Basic Y3dhZGRpbmc6ZnY1MHhFZ0d3Ug==
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
accept:
|
15
|
+
- ! '*/*'
|
16
|
+
user-agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
server:
|
24
|
+
- Netwave IP Camera
|
25
|
+
date:
|
26
|
+
- Thu, 01 Jan 1970 01:36:50 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '4'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'ok.
|
38
|
+
|
39
|
+
'
|
40
|
+
http_version: '1.1'
|
41
|
+
recorded_at: Wed, 12 Dec 2012 04:33:06 GMT
|
42
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/set_users.cgi?pri2=0&pwd2=pass2&user2=user2
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
authorization:
|
11
|
+
- Basic Y3dhZGRpbmc6ZnY1MHhFZ0d3Ug==
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
accept:
|
15
|
+
- ! '*/*'
|
16
|
+
user-agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
server:
|
24
|
+
- Netwave IP Camera
|
25
|
+
date:
|
26
|
+
- Thu, 01 Jan 1970 01:12:11 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '22'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'error: illegal params.'
|
38
|
+
http_version: '1.1'
|
39
|
+
recorded_at: Wed, 12 Dec 2012 04:08:25 GMT
|
40
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/set_users.cgi?pri3=0&pwd3=pass3&user3=user3
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
authorization:
|
11
|
+
- Basic Y3dhZGRpbmc6ZnY1MHhFZ0d3Ug==
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
accept:
|
15
|
+
- ! '*/*'
|
16
|
+
user-agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
server:
|
24
|
+
- Netwave IP Camera
|
25
|
+
date:
|
26
|
+
- Thu, 01 Jan 1970 01:12:53 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '22'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'error: illegal params.'
|
38
|
+
http_version: '1.1'
|
39
|
+
recorded_at: Wed, 12 Dec 2012 04:09:07 GMT
|
40
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/set_users.cgi?pri4=0&pwd4=pass4&user4=user4
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
authorization:
|
11
|
+
- Basic Y3dhZGRpbmc6ZnY1MHhFZ0d3Ug==
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
accept:
|
15
|
+
- ! '*/*'
|
16
|
+
user-agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
server:
|
24
|
+
- Netwave IP Camera
|
25
|
+
date:
|
26
|
+
- Thu, 01 Jan 1970 01:12:53 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '22'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'error: illegal params.'
|
38
|
+
http_version: '1.1'
|
39
|
+
recorded_at: Wed, 12 Dec 2012 04:09:07 GMT
|
40
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/set_users.cgi?pri5=0&pwd4=pass5&user5=user5
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
authorization:
|
11
|
+
- Basic Y3dhZGRpbmc6ZnY1MHhFZ0d3Ug==
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
accept:
|
15
|
+
- ! '*/*'
|
16
|
+
user-agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
server:
|
24
|
+
- Netwave IP Camera
|
25
|
+
date:
|
26
|
+
- Thu, 01 Jan 1970 01:14:25 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '22'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'error: illegal params.'
|
38
|
+
http_version: '1.1'
|
39
|
+
recorded_at: Wed, 12 Dec 2012 04:10:39 GMT
|
40
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/set_users.cgi?pri6=0&pwd6=pass6&user6=user6
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
authorization:
|
11
|
+
- Basic Y3dhZGRpbmc6ZnY1MHhFZ0d3Ug==
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
accept:
|
15
|
+
- ! '*/*'
|
16
|
+
user-agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
server:
|
24
|
+
- Netwave IP Camera
|
25
|
+
date:
|
26
|
+
- Thu, 01 Jan 1970 01:14:25 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '22'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'error: illegal params.'
|
38
|
+
http_version: '1.1'
|
39
|
+
recorded_at: Wed, 12 Dec 2012 04:10:39 GMT
|
40
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/set_users.cgi?pri7=0&pwd7=pass7&user7=user7
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
authorization:
|
11
|
+
- Basic Y3dhZGRpbmc6ZnY1MHhFZ0d3Ug==
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
accept:
|
15
|
+
- ! '*/*'
|
16
|
+
user-agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
server:
|
24
|
+
- Netwave IP Camera
|
25
|
+
date:
|
26
|
+
- Thu, 01 Jan 1970 01:14:25 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '22'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'error: illegal params.'
|
38
|
+
http_version: '1.1'
|
39
|
+
recorded_at: Wed, 12 Dec 2012 04:10:39 GMT
|
40
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/set_users.cgi?pri8=0&pwd7=pass8&user8=user8
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
authorization:
|
11
|
+
- Basic Y3dhZGRpbmc6ZnY1MHhFZ0d3Ug==
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
accept:
|
15
|
+
- ! '*/*'
|
16
|
+
user-agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
server:
|
24
|
+
- Netwave IP Camera
|
25
|
+
date:
|
26
|
+
- Thu, 01 Jan 1970 01:15:00 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '22'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'error: illegal params.'
|
38
|
+
http_version: '1.1'
|
39
|
+
recorded_at: Wed, 12 Dec 2012 04:11:14 GMT
|
40
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/set_wifi.cgi?enable=1&encrypt=1&ssid=my_wireless_ssid&wpa_psk=my_wireless_password
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
authorization:
|
11
|
+
- Basic Y3dhZGRpbmc6ZnY1MHhFZ0d3Ug==
|
12
|
+
accept-encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
accept:
|
15
|
+
- ! '*/*'
|
16
|
+
user-agent:
|
17
|
+
- Ruby
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
server:
|
24
|
+
- Netwave IP Camera
|
25
|
+
date:
|
26
|
+
- Thu, 13 Dec 2012 00:43:08 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '22'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'error: illegal params.'
|
38
|
+
http_version: '1.1'
|
39
|
+
recorded_at: Thu, 13 Dec 2012 00:43:11 GMT
|
40
|
+
recorded_with: VCR 2.3.0
|