在研究回答这个问题时SO Question, 偶然发现了这个,这给了我最后的暗示。
我将复制相关部分:
函数get\\u stats\\u csv/plugins/jetpack/modules/stats.php
功能get_stats_csv
呼叫http://stats.wordpress.com/csv.php
. 如果我们访问此地址,我们会得到以下响应:
Error: api_key is a required parameter.
Required parameters: api_key, blog_id or blog_uri.
Optional parameters: table, post_id, end, days, limit, summarize.
Parameters:
api_key String A secret unique to your WordPress.com user account.
blog_id Integer The number that identifies your blog.
Find it in other stats URLs.
blog_uri String The full URL to the root directory of your blog.
Including the full path.
table String One of views, postviews, referrers, referrers_grouped,
searchterms, clicks, videoplays.
post_id Integer For use with postviews table.
end String The last day of the desired time frame.
Format is \'Y-m-d\' (e.g. 2007-05-01)
and default is UTC date.
days Integer The length of the desired time frame.
Default is 30. "-1" means unlimited.
period String For use with views table and the \'days\' parameter.
The desired time period grouping. \'week\' or \'month\'
Use \'days\' as the number of results to return
(e.g. \'&period=week&days=12\' to return 12 weeks)
limit Integer The maximum number of records to return.
Default is 100. "-1" means unlimited.
If days is -1, limit is capped at 500.
summarize Flag If present, summarizes all matching records.
format String The format the data is returned in,
\'csv\', \'xml\' or \'json\'.
Default is \'csv\'.
Non-working query example:
?api_key=123456789abc&blog_id=155&table=referrers&days=30&limit=-1&summarize
Result format is csv with one row per line and column names in first row.
Strings containing double quotes, commas, or "\\n" are enclosed in double-quotes.
Double-qoutes in strings are escaped by inserting another double-quote.
Example: "pet food" recipe
Becomes: """pet food"" recipe"
Developers, please cache the results for at least 180 seconds.
就我对本文档的理解而言,使用
period=week&days=1&limit=-1\'
将从返回所有帖子
1 周时段。如果我们使用
days=2
这将是一个
2 周周期。
一周似乎是最短的时间。您必须将Jetpack结果与仅两天的内部查询进行比较,然后过滤结果。
Take that developers note seriously, 看起来我在测试时打破了每日(希望如此)配额。函数不再返回结果,甚至阻止我的代码运行。。。没有什么东西会坏,只是不要跑。