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,42 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/camera_control.cgi?param=1&value=160
|
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 00:45:18 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 03:41:31 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/camera_control.cgi?param=2&value=4
|
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 00:45:19 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 03:41:31 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/camera_control.cgi?param=3&value=2
|
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 00:46:15 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 03:42:28 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/camera_control.cgi?param=5&value=2
|
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 00:45:19 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 03:41:33 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/camera_control.cgi?param=0&value=8
|
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 00:45:16 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 03:41:30 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/comm_write.cgi?baud=15&bytes=dsfds&data=url_code&port=0
|
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 02:05:34 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 02:05:33 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/decoder_control.cgi?command=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 00:32:28 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 03:28:39 GMT
|
42
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/get_camera_params.cgi
|
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
|
+
- Tue, 13 Nov 2012 05:01:50 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '89'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'var resolution=8;
|
38
|
+
|
39
|
+
var brightness=169;
|
40
|
+
|
41
|
+
var contrast=2;
|
42
|
+
|
43
|
+
var mode=1;
|
44
|
+
|
45
|
+
var flip=0;
|
46
|
+
|
47
|
+
var fps=0;
|
48
|
+
|
49
|
+
'
|
50
|
+
http_version: '1.1'
|
51
|
+
recorded_at: Tue, 13 Nov 2012 05:01:50 GMT
|
52
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,84 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/get_forbidden.cgi
|
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
|
+
- Tue, 13 Nov 2012 05:02:51 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '485'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'var schedule_enable=0;
|
38
|
+
|
39
|
+
var schedule_sun_0=0;
|
40
|
+
|
41
|
+
var schedule_sun_1=0;
|
42
|
+
|
43
|
+
var schedule_sun_2=0;
|
44
|
+
|
45
|
+
var schedule_mon_0=0;
|
46
|
+
|
47
|
+
var schedule_mon_1=0;
|
48
|
+
|
49
|
+
var schedule_mon_2=0;
|
50
|
+
|
51
|
+
var schedule_tue_0=0;
|
52
|
+
|
53
|
+
var schedule_tue_1=0;
|
54
|
+
|
55
|
+
var schedule_tue_2=0;
|
56
|
+
|
57
|
+
var schedule_wed_0=0;
|
58
|
+
|
59
|
+
var schedule_wed_1=0;
|
60
|
+
|
61
|
+
var schedule_wed_2=0;
|
62
|
+
|
63
|
+
var schedule_thu_0=0;
|
64
|
+
|
65
|
+
var schedule_thu_1=0;
|
66
|
+
|
67
|
+
var schedule_thu_2=0;
|
68
|
+
|
69
|
+
var schedule_fri_0=0;
|
70
|
+
|
71
|
+
var schedule_fri_1=0;
|
72
|
+
|
73
|
+
var schedule_fri_2=0;
|
74
|
+
|
75
|
+
var schedule_sat_0=0;
|
76
|
+
|
77
|
+
var schedule_sat_1=0;
|
78
|
+
|
79
|
+
var schedule_sat_2=0;
|
80
|
+
|
81
|
+
'
|
82
|
+
http_version: '1.1'
|
83
|
+
recorded_at: Tue, 13 Nov 2012 05:02:51 GMT
|
84
|
+
recorded_with: VCR 2.3.0
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://my_username:my_password@192.168.0.117/get_misc.cgi
|
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
|
+
- Tue, 13 Nov 2012 05:02:51 GMT
|
27
|
+
content-type:
|
28
|
+
- text/plain
|
29
|
+
content-length:
|
30
|
+
- '343'
|
31
|
+
cache-control:
|
32
|
+
- no-cache
|
33
|
+
connection:
|
34
|
+
- close
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: ! 'var led_mode=1;
|
38
|
+
|
39
|
+
var ptz_center_onstart=1;
|
40
|
+
|
41
|
+
var ptz_auto_patrol_interval=0;
|
42
|
+
|
43
|
+
var ptz_auto_patrol_type=0;
|
44
|
+
|
45
|
+
var ptz_patrol_h_rounds=2;
|
46
|
+
|
47
|
+
var ptz_patrol_v_rounds=2;
|
48
|
+
|
49
|
+
var ptz_patrol_rate=10;
|
50
|
+
|
51
|
+
var ptz_patrol_up_rate=6;
|
52
|
+
|
53
|
+
var ptz_patrol_down_rate=6;
|
54
|
+
|
55
|
+
var ptz_patrol_left_rate=6;
|
56
|
+
|
57
|
+
var ptz_patrol_right_rate=6;
|
58
|
+
|
59
|
+
var ptz_disable_preset=1;
|
60
|
+
|
61
|
+
var ptz_preset_onstart=0;
|
62
|
+
|
63
|
+
'
|
64
|
+
http_version: '1.1'
|
65
|
+
recorded_at: Tue, 13 Nov 2012 05:02:51 GMT
|
66
|
+
recorded_with: VCR 2.3.0
|