wechat-shake_around 0.3 → 0.4

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: 875e9436ab8c3ee96401b149eee9e6fdf21835c8
4
- data.tar.gz: 13f800097d3b6ff7cc22d1f01f3c3f2a4ea7fd0d
3
+ metadata.gz: a736132f426e81fc4bd86bf97afbdfddf7f8a49c
4
+ data.tar.gz: c27ef6734e3af540ebeeff4621bac76b360b9a0a
5
5
  SHA512:
6
- metadata.gz: c54a9effe59ce22a81b2eb3a252fb8f46b20539e05ac31d4329d7386a44d8689387804d0cc4ab9f94dccf578ed360ac2de059ed64c611fc36647b236a2f70242
7
- data.tar.gz: fe808be353d7489e634ccc8ba702c51c61e666c1b4198464561167a9ea04b8376952791501cf45d77c37d9e2e870a55eecfd7c08094b5e4bc3597c8f163cc698
6
+ metadata.gz: a16423788bbde419dbc00d1747ebeb33c383a4c79d30d1701053616a72367a2d6a55663760443be0128e8fd76ddf9dde72d79e559e51c8135785bfcd7865f03d
7
+ data.tar.gz: 7033e16157b450669337cfde00893d57a13c086256b2d5adf7b25907aacb6094381fedb12a4c6e88c5144982ae0a895c1883e6906d3e4f106798bd748814324a
data/CHANGELOG.md CHANGED
@@ -13,3 +13,7 @@
13
13
  ## v0.3
14
14
  1. Page wrapper class
15
15
  2. Beacon Page Relation wrapper class
16
+
17
+ ## v0.4
18
+ 1. Page Report wrapper class
19
+ 2. Page Daily Report wrapper class
@@ -8,8 +8,13 @@ require 'wechat/shake_around/material'
8
8
  require 'wechat/shake_around/icon'
9
9
  require 'wechat/shake_around/license'
10
10
 
11
+ require 'wechat/shake_around/page'
12
+ require 'wechat/shake_around/beacon_page_relation'
13
+
14
+ require 'wechat/shake_around/page_report'
15
+ require 'wechat/shake_around/page_daily_report'
16
+
11
17
  module Wechat
12
18
  module ShakeAround
13
- # Your code goes here...
14
19
  end
15
20
  end
@@ -0,0 +1,40 @@
1
+ require 'jsonclient'
2
+
3
+ class Wechat::ShakeAround::PageDailyReport
4
+
5
+ extend ::Wechat::ShakeAround::Common
6
+
7
+ # 以页面为维度的数据统计接口
8
+ # http://mp.weixin.qq.com/wiki/0/8a24bcacad40fe7ee98d1573cb8a6764.html#.E4.BB.A5.E9.A1.B5.E9.9D.A2.E4.B8.BA.E7.BB.B4.E5.BA.A6.E7.9A.84.E6.95.B0.E6.8D.AE.E7.BB.9F.E8.AE.A1.E6.8E.A5.E5.8F.A3
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
+ # page_id is an integer 指定页面的ID
28
+ # date_range is a string range like 'yyyy-mm-dd'..'yyyy-mm-dd'.
29
+ def self.index(access_token, page_id, date_range)
30
+
31
+ message = ::JSONClient.new.post "https://api.weixin.qq.com/shakearound/statistics/page?access_token=#{access_token}",
32
+ {
33
+ page_id: page_id.to_i,
34
+ begin_date: normalize_date(date_range.min),
35
+ end_date: normalize_date(date_range.max)
36
+ }
37
+ message.body
38
+ end
39
+
40
+ end
@@ -0,0 +1,44 @@
1
+ require 'jsonclient'
2
+
3
+ class Wechat::ShakeAround::PageReport
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.E9.A1.B5.E9.9D.A2.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
+ # pages:
15
+ # [
16
+ # {
17
+ # page_id: <PAGE_ID>,
18
+ # shake_pv: <SHAKE_PAGE_VIEW>,
19
+ # shake_uv: <SHAKE_USER_VIEW>,
20
+ # click_pv: <CLICK_PAGE_VIEW>,
21
+ # click_uv: <CLICK_USER_VIEW>
22
+ # },
23
+ # ...
24
+ # ]
25
+ # },
26
+ # date: <DATE>, // 所查询的日期时间戳
27
+ # total_count: <TOTAL_COUNT>, // 页面总数
28
+ # page_index: <PAGE_INDEX>, // 所查询的结果页序号;返回结果按摇周边人数降序排序,每50条记录为一页
29
+ # errcode: 0,
30
+ # errmsg: 'success.'
31
+ # }
32
+ #
33
+ # date: 指定查询日期时间戳,单位为秒。
34
+ # page_index: 指定查询的结果页序号;返回结果按摇周边人数降序排序,每50条记录为一页 ,从1开始。
35
+ def self.index(access_token, date, page_index = 1)
36
+ message = ::JSONClient.new.post "https://api.weixin.qq.com/shakearound/statistics/pagelist?access_token=#{access_token}",
37
+ {
38
+ date: normalize_date(date),
39
+ page_index: page_index.to_i
40
+ }
41
+ message.body
42
+ end
43
+
44
+ end
@@ -1,5 +1,5 @@
1
1
  module Wechat
2
2
  module ShakeAround
3
- VERSION = '0.3'.freeze
3
+ VERSION = '0.4'.freeze
4
4
  end
5
5
  end
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
10
10
  spec.authors = [ 'Topbit Du' ]
11
11
  spec.email = [ 'topbit.du@gmail.com' ]
12
12
 
13
- spec.summary = %q{Wechat Shake Around Library}
14
- spec.description = %q{The Wechat Shake Around Library is a code base to handle the shaking around API calls.}
13
+ spec.summary = %q{Wechat Shake Around Library 微信摇周边库}
14
+ spec.description = %q{The Wechat Shake Around Library is a code base to handle the shaking around API calls. 微信摇周边库封装了微信摇周边API的调用。}
15
15
  spec.homepage = 'https://github.com/topbitdu/wechat-shake_around'
16
16
  spec.license = 'MIT'
17
17
 
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.3'
4
+ version: '0.4'
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-17 00:00:00.000000000 Z
11
+ date: 2016-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.7'
69
69
  description: The Wechat Shake Around Library is a code base to handle the shaking
70
- around API calls.
70
+ around API calls. 微信摇周边库封装了微信摇周边API的调用。
71
71
  email:
72
72
  - topbit.du@gmail.com
73
73
  executables: []
@@ -94,6 +94,8 @@ files:
94
94
  - lib/wechat/shake_around/license.rb
95
95
  - lib/wechat/shake_around/material.rb
96
96
  - lib/wechat/shake_around/page.rb
97
+ - lib/wechat/shake_around/page_daily_report.rb
98
+ - lib/wechat/shake_around/page_report.rb
97
99
  - lib/wechat/shake_around/shaking.rb
98
100
  - lib/wechat/shake_around/version.rb
99
101
  - wechat-shake_around.gemspec
@@ -120,5 +122,5 @@ rubyforge_project:
120
122
  rubygems_version: 2.4.5.1
121
123
  signing_key:
122
124
  specification_version: 4
123
- summary: Wechat Shake Around Library
125
+ summary: Wechat Shake Around Library 微信摇周边库
124
126
  test_files: []