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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33f0f6248f85c972d54a967d495b83344a1ad080
4
- data.tar.gz: 00dfd8e3db21e725a6238a838f1b56ae2a87464d
3
+ metadata.gz: 44cee407e50a4c30b276fb1cecb57a98cdd75901
4
+ data.tar.gz: d38d7b7ae6aeac5a63046b9cdcc11befe46912d7
5
5
  SHA512:
6
- metadata.gz: 55b19f41cf216956dd81f0c739b0192eb86aed60dd726a34072022e6d7d68516dd39d3886ab471cab3fb1d5445e910bdf2825bdeb9d85caf15df2309ce025ec1
7
- data.tar.gz: 31a2666add610c74e75e613e0adbc7b5d1d94a839252a3060c067a5a6fe98e4620233c759902dad76ec1428aad2c784cdf7c9f319f5d821dd5ee6f54a73599fd
6
+ metadata.gz: c0f8c8fdf8139f0f3158431f36d3eac1cd178b77e8504be5d3fcb25d71c689639a87b7dae69574c4691a9f375d5cc0107078c677ebd3a58de97ad5a37d017378
7
+ data.tar.gz: 02d385f3f1e1ec5ee9f97aff371353b2d9c627b2f34a7755d3bf83652fcc0772e75232f67bfbbabd93f121d798465f2032f07a1fc7285a9e2001223cc123f9f1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arlo (0.0.2)
4
+ arlo (0.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
@@ -5,4 +5,5 @@ module Arlo
5
5
  require 'arlo/token'
6
6
  require 'arlo/profile'
7
7
  require 'arlo/devices'
8
+ require 'arlo/library'
8
9
  end
@@ -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
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Arlo
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
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.2
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