Class: Wechat::ShakeAround::PageDailyReport
- Inherits:
-
Object
- Object
- Wechat::ShakeAround::PageDailyReport
- Extended by:
- Core::Common, Common
- Defined in:
- lib/wechat/shake_around/page_daily_report.rb
Constant Summary
Constants included from Common
Class Method Summary collapse
Methods included from Common
normalize_date, normalize_device_id, normalize_page_ids
Class Method Details
.index(access_token, page_id, date_range) ⇒ Object
Return hash format if success: {
data:
[
{
click_pv: <CLICK_PAGE_VIEW>,
click_uv: <CLICK_USER_VIEW>,
ftime: <DATE>, //
}
page_id is an integer 指定页面的ID date_range is a string range like ‘yyyy-mm-dd’..‘yyyy-mm-dd’.
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/wechat/shake_around/page_daily_report.rb', line 28 def self.index(access_token, page_id, date_range) assert_present! :access_token, access_token assert_present! :page_id, page_id assert_present! :date_range, date_range = post_json "https://api.weixin.qq.com/shakearound/statistics/page?access_token=#{access_token}", body: { page_id: page_id.to_i, begin_date: normalize_date(date_range.min), end_date: normalize_date(date_range.max) } .body end |