wechat-shake_around 0.5 → 0.6

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: 784c7c95779fa71b20d5b1a045ac253b21c81d31
4
- data.tar.gz: 2666c404cb67a5b820221827793b9d83fa63edfd
3
+ metadata.gz: c812020d6f9748bbcf3681e1d0348e55b432ce51
4
+ data.tar.gz: 9d005e0b59d61dca6a5de2bb7c1a855020bab900
5
5
  SHA512:
6
- metadata.gz: 11d46eb0445ed118dd4fbecd366665ea308fdd24d14910066b1c9125daaa3e91a56afe2c8382b1dc6b4c1cc1ca51718370654563d15f581e2b1aa8bb496363fa
7
- data.tar.gz: d3690fab70c308a891aee22f32a0a9663a19fd3198d02799b5577e023a0d88f8521c7e2ab4dfc31bc1adfc07fdb51ea73474588d4ef8791930d8f9018b6fb505
6
+ metadata.gz: a24b0e25d8877ae911751d641aad15125455f38b595e8d55598499101ed0fd033a62e1622341148f01927e1e9ae1b493f6da5cd1df4ab8006fd49a64d11efc76
7
+ data.tar.gz: 08e79af2f304c0962398bb9ff27b6cc0974cde7b69d87e9849fcdd015bef55e637b7afe22ac1bb38058aed45159663a0810699c20579adb8162f5fa194f1592c
data/CHANGELOG.md CHANGED
@@ -21,3 +21,7 @@
21
21
  ## v0.5
22
22
  1. Group wrapper class
23
23
  2. Device Group Relation wrapper class
24
+
25
+ ## v0.6
26
+ 1. Device Report wrapper class
27
+ 2. Device Daily Report wrapper class
@@ -0,0 +1,43 @@
1
+ require 'jsonclient'
2
+
3
+ class Wechat::ShakeAround::DeviceDailyReport
4
+
5
+ extend ::Wechat::ShakeAround::Common
6
+
7
+ # 以设备为维度的数据统计接口
8
+ # http://mp.weixin.qq.com/wiki/0/8a24bcacad40fe7ee98d1573cb8a6764.html
9
+ #
10
+ # Return hash format if success:
11
+ # {
12
+ # data:
13
+ # [
14
+ # {
15
+ # click_pv: <CLICK_PAGE_VIEW>,
16
+ # click_uv: <CLICK_USER_VIEW>,
17
+ # ftime: <DATE>, // 当天0点对应的时间戳
18
+ # shake_pv: <SHAKE_PAGE_VIEW>,
19
+ # shake_uv: <SHAKE_USER_VIEW>
20
+ # },
21
+ # ...
22
+ # ],
23
+ # errcode: 0,
24
+ # errmsg: 'success.'
25
+ # }
26
+ #
27
+ # device_id is an integer or a hash like { uuid: <UUID>, major: <MAJOR>, minor: <MINOR> }.
28
+ # date_range is a string range like 'yyyy-mm-dd'..'yyyy-mm-dd'.
29
+ def self.index(access_token, device_id, date_range)
30
+
31
+ device_identifier = normalize_device_id device_id
32
+
33
+ message = ::JSONClient.new.post "https://api.weixin.qq.com/shakearound/statistics/device?access_token=#{access_token}",
34
+ {
35
+ device_identifier: device_identifier,
36
+ begin_date: normalize_date(date_range.min),
37
+ end_date: normalize_date(date_range.max)
38
+ }
39
+ message.body
40
+
41
+ end
42
+
43
+ end
@@ -0,0 +1,47 @@
1
+ require 'jsonclient'
2
+
3
+ class Wechat::ShakeAround::DeviceReport
4
+
5
+ extend ::Wechat::ShakeAround::Common
6
+
7
+ # 批量查询设备统计数据接口
8
+ # http://mp.weixin.qq.com/wiki/0/8a24bcacad40fe7ee98d1573cb8a6764.html#.E6.89.B9.E9.87.8F.E6.9F.A5.E8.AF.A2.E8.AE.BE.E5.A4.87.E7.BB.9F.E8.AE.A1.E6.95.B0.E6.8D.AE.E6.8E.A5.E5.8F.A3
9
+ #
10
+ # Return hash format if success:
11
+ # {
12
+ # data:
13
+ # {
14
+ # devices:
15
+ # [
16
+ # {
17
+ # device_id: <DEVICE_ID>,
18
+ # major: <MAJOR>,
19
+ # minor: <MINOR>,
20
+ # uuid: <UUID>,
21
+ # shake_pv: <SHAKE_PAGE_VIEW>,
22
+ # shake_uv: <SHAKE_USER_VIEW>,
23
+ # click_pv: <CLICK_PAGE_VIEW>,
24
+ # click_uv: <CLICK_USER_VIEW>
25
+ # },
26
+ # ...
27
+ # ]
28
+ # },
29
+ # date: <DATE>, // 所查询的日期时间戳
30
+ # total_count: <TOTAL_COUNT>, // 设备总数
31
+ # page_index: <PAGE_INDEX>, // 所查询的结果页序号;返回结果按摇周边人数降序排序,每50条记录为一页
32
+ # errcode: 0,
33
+ # errmsg: 'success.'
34
+ # }
35
+ #
36
+ # date: 指定查询日期时间戳,单位为秒。
37
+ # page_index: 指定查询的结果页序号;返回结果按摇周边人数降序排序,每50条记录为一页,从1开始。
38
+ def self.index(access_token, date, page_index = 1)
39
+ message = ::JSONClient.new.post "https://api.weixin.qq.com/shakearound/statistics/devicelist?access_token=#{access_token}",
40
+ {
41
+ date: normalize_date(date),
42
+ page_index: page_index.to_i
43
+ }
44
+ message.body
45
+ end
46
+
47
+ end
@@ -1,5 +1,5 @@
1
1
  module Wechat
2
2
  module ShakeAround
3
- VERSION = '0.5'.freeze
3
+ VERSION = '0.6'.freeze
4
4
  end
5
5
  end
@@ -14,6 +14,12 @@ require 'wechat/shake_around/beacon_page_relation'
14
14
  require 'wechat/shake_around/page_report'
15
15
  require 'wechat/shake_around/page_daily_report'
16
16
 
17
+ require 'wechat/shake_around/group'
18
+ require 'wechat/shake_around/device_group_relation'
19
+
20
+ require 'wechat/shake_around/device_report'
21
+ require 'wechat/shake_around/device_daily_report'
22
+
17
23
  module Wechat
18
24
  module ShakeAround
19
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wechat-shake_around
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.6'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-19 00:00:00.000000000 Z
11
+ date: 2016-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -90,7 +90,9 @@ files:
90
90
  - lib/wechat/shake_around/beacon.rb
91
91
  - lib/wechat/shake_around/beacon_page_relation.rb
92
92
  - lib/wechat/shake_around/common.rb
93
+ - lib/wechat/shake_around/device_daily_report.rb
93
94
  - lib/wechat/shake_around/device_group_relation.rb
95
+ - lib/wechat/shake_around/device_report.rb
94
96
  - lib/wechat/shake_around/group.rb
95
97
  - lib/wechat/shake_around/icon.rb
96
98
  - lib/wechat/shake_around/license.rb