Example call: https://{primary app language call}.wikipedia.org/w/rest.php/growthexperiments/v0/user-impact/%2335904678?lang=en
Example response: https://drive.google.com/file/d/1LbbstJwqVh6fmWe13Q_o-dSNif29GdMk/view?usp=drive_link
- Cleanup: Create a WMFUserImpactDataController, have it make the same call that YearInReviewViewCountSlideDataController does. Ask YearInReviewViewCountSlideDataController to fetch the data from ImpactModuleDataController instead of making the call itself.
- Add a method in ActivityTabDataController that calls WMFUserImpactDataController and fetches this user impact data.
- Still within ActivityTabDataController method, after step 3 fetch completes, grab the top 3 articles in topViewedArticles object in response.
Data to return:
Most viewed since your edit
Top 3 topViewedArticles. Also return the "views" object by day. We can use it to build the line graph if we have time later.
Contributions this month
Will be aggregated from the editCountByDay response, bucketed from current calendar month and last calendar month.
All time impact
Total edits - totalEditsCount from step 3 (WMFUserImpactDataController)
Thanks - givenThanksCount from step 3 (WMFUserImpactDataController)
Best streak - longestEditingStreak.days from step 3 (WMFUserImpactDataController)
Last edited - lastEditTimestamp from step 3 (WMFUserImpactDataController)
Your recent activity (last 30 days)
editCountByDay from step 3 (WMFUserImpactDataController)
Prune anything outside of last 30 days. Then add days missing in-between and send an edit count of 0, up to the last 30 days.
Views on articles you've edited
dailyTotalViews from step 3 (WMFUserImpactDataController)
Nice-to-have: Add lightweight caching for user impact module API data. Currently we see this error for https://en.wikipedia.org/w/rest.php/growthexperiments/v0/user-impact/%2335904678?lang=en
{
"message": "Too many requests to refresh user impact data",
"httpCode": 429,
"httpReason": "Too Many Requests"
}