Currently the apps use the pageviews API in order to show users a list of what was popular yesterday. While this is good for historical data, it would be better to provide a more timely list of popular articles.
To do this we need a more up to data data source to identify trending articles. @Jdlrobson as created a trending site on labs:
http://trending.wmflabs.org
Which is powered by an API:
http://trending.wmflabs.org/api/trending/
This works by consuming the edits stream (rcstream) and running an algorithm to determine if an article is trending by analyzing the edits. This appears to be a viable way to get a handle on trending articles.
To use this in production we need to port this work over to using the mobile content service as an API
The GET /trending/edits API should have 2 modes:
- Return a list of the currently trending articles in order of "trendiness" at any time.
- Return a list of trending articles chronologically in the order that they became "trendy"
During implementation, it should be considered that this service (or some of its logic) will be used to develop a trending push notification service in order to push the most significant trending articles to users.
Timeline for deployment is 2-3 months with iOS and Android using this service to power a new section in the Explore Feed.
See meeting notes here:
https://docs.google.com/document/d/1gr_Ww3JNAMPGcjdbuYLDdlDFVvNhknoC2ZOQf7biDPM/edit#
The JSON array for each page returned should use the same common keys/values as the feed endpoint (https://en.wikipedia.org/api/rest_v1/feed/featured/2016/06/08).
These keys includes: title, pageid, thumbnail, normalized title, description. See the example JSON:
"pages": [ { "title": "Kimbo_Slice", "pageid": 17709998, "thumbnail": { "source": "http://upload.wikimedia.org/wikipedia/commons/thumb/4/42/Kimbo_Slice_1.jpg/207px-Kimbo_Slice_1.jpg", "width": 207, "height": 320 }, "normalizedtitle": "Kimbo Slice", "description": "American professional wrestler" }, { "title": "Muhammad_Ali", "pageid": 63747, "thumbnail": { "source": "http://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Muhammad_Ali_NYWTS.jpg/256px-Muhammad_Ali_NYWTS.jpg", "width": 256, "height": 320 }, "normalizedtitle": "Muhammad Ali", "description": "African American boxer, philanthropist and activist" } ]
Prior to deployment we need to migrate to the Change Propagation service:
https://www.mediawiki.org/wiki/Change_propagation
@mobrovac can help guide the transition from the RCS to this. It should be relatively trivial.