[wp-meta] [Making WordPress.org] #3037: WordPress.tv: Show the views of the video

Making WordPress.org noreply at wordpress.org
Tue Dec 6 22:59:33 UTC 2022


#3037: WordPress.tv: Show the views of the video
--------------------------+---------------------
 Reporter:  Mte90         |       Owner:  (none)
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:
Component:  WordPress.tv  |  Resolution:
 Keywords:  needs-patch   |
--------------------------+---------------------

Comment (by mboynes):

 I was able to confirm that Jetpack can request that API endpoint using:

 {{{#!php
 Automattic\Jetpack\Connection\Client::wpcom_json_api_request_as_blog();
 }}}

 Now having used the API endpoint, it looks like it might **not** be
 possible to get a simple cumulative view count  for a video. Perhaps
 someone from WordPress.com could chime in to offer some insight, but as
 far as I can tell from
 [https://developer.wordpress.com/docs/api/1.1/get/sites/%24site/stats/video/%24post_id/
 the docs], the response only returns views over a requested period of
 time: day, week, month, or year. If we say `period=all` it gives the last
 60 days, I guess. When we query `period=year`, we get the last 12-13
 months, and we can add them up to get total views over the last year, but
 that looks to be as far back as we can go.

 Can anyone offer an undocumented solution to getting the total view count
 for a video?

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/3037#comment:10>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list