arlo 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -0
- data/lib/arlo.rb +1 -0
- data/lib/arlo/library.rb +12 -0
- data/lib/arlo/network_helper.rb +4 -3
- data/lib/arlo/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44cee407e50a4c30b276fb1cecb57a98cdd75901
|
4
|
+
data.tar.gz: d38d7b7ae6aeac5a63046b9cdcc11befe46912d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0f8c8fdf8139f0f3158431f36d3eac1cd178b77e8504be5d3fcb25d71c689639a87b7dae69574c4691a9f375d5cc0107078c677ebd3a58de97ad5a37d017378
|
7
|
+
data.tar.gz: 02d385f3f1e1ec5ee9f97aff371353b2d9c627b2f34a7755d3bf83652fcc0772e75232f67bfbbabd93f121d798465f2032f07a1fc7285a9e2001223cc123f9f1
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -51,6 +51,10 @@ Call this to get the list of devices (including basestations) registered with th
|
|
51
51
|
|
52
52
|
Call this to get device information.
|
53
53
|
|
54
|
+
## get_library
|
55
|
+
|
56
|
+
Call this to get the library's index of all the recordings it has between the two supplied dates.
|
57
|
+
|
54
58
|
# TODO
|
55
59
|
|
56
60
|
* Provide a convenient interface to manage devices
|
data/lib/arlo.rb
CHANGED
data/lib/arlo/library.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
module Arlo
|
2
|
+
class API
|
3
|
+
def get_library(token, from_date, to_date)
|
4
|
+
payload = {
|
5
|
+
"dateFrom": "20180802",
|
6
|
+
"dateTo": "20180803"
|
7
|
+
}
|
8
|
+
library = post('https://arlo.netgear.com/hmsweb/users/library', payload, token)
|
9
|
+
JSON.parse(library.body)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/arlo/network_helper.rb
CHANGED
@@ -11,19 +11,20 @@ module Arlo
|
|
11
11
|
http.use_ssl = true
|
12
12
|
|
13
13
|
request = Net::HTTP::Get.new(uri)
|
14
|
-
request.add_field('Content-Type', 'application/json')
|
14
|
+
request.add_field('Content-Type', 'application/json;charset=UTF-8')
|
15
15
|
request.add_field('Authorization', token)
|
16
16
|
|
17
17
|
http.request(request)
|
18
18
|
end
|
19
19
|
|
20
|
-
def post url, payload
|
20
|
+
def post url, payload, token = nil
|
21
21
|
uri = URI.parse(url)
|
22
22
|
http = Net::HTTP.new(uri.host, uri.port)
|
23
23
|
http.use_ssl = true
|
24
24
|
|
25
25
|
request = Net::HTTP::Post.new(uri)
|
26
|
-
request.add_field('Content-Type', 'application/json')
|
26
|
+
request.add_field('Content-Type', 'application/json;charset=UTF-8')
|
27
|
+
request.add_field('Authorization', token) if token
|
27
28
|
request.body = payload.to_json
|
28
29
|
|
29
30
|
http.request(request)
|
data/lib/arlo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arlo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Itamar Hassin
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- exe/arlo
|
110
110
|
- lib/arlo.rb
|
111
111
|
- lib/arlo/devices.rb
|
112
|
+
- lib/arlo/library.rb
|
112
113
|
- lib/arlo/network_helper.rb
|
113
114
|
- lib/arlo/profile.rb
|
114
115
|
- lib/arlo/token.rb
|