Closed Bug 632076 Opened 14 years ago Closed 14 years ago

[Demo Studio] Implement up-and-coming sort order

Categories

(developer.mozilla.org Graveyard :: Demo Studio / Dev Derby, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lorchard, Assigned: lorchard)

Details

The support for an up-and-coming sort order of demo submissions is incomplete. The idea is to use a daily cron task to sum up the last 24 hours' worth of likes and launches. The sum of those, or some other formula, can form the basis for an up-and-coming score representing demos that are receiving favorable attention recently versus older demos with built-up activity. The actioncounters app implements counters for likes and launches, along with columns to hold the daily sums. There is also a table tracking timestamped counter increments per unique host attributes. What's missing is a management command and cronjob to update demos with daily counter sums, and a formula on which to base sorting. Having some activity in the database after initial launch could help, too
Target Milestone: --- → 0.9.4
Bumping to MDN 0.9.5, this will be a great feature to get in for that release.
Target Milestone: 0.9.4 → 0.9.5
I've got some code in progress to throw at this, hopefully will work.
Assignee: nobody → lorchard
Status: NEW → ASSIGNED
https://github.com/mozilla/kuma/commit/a169a8e46cb2303a1a04d66ff2c98ec4ab0b91be This code wraps up the up-and-coming sort order, I think. The up-and-coming order will sort by recent likes, with recent launches as a tie breaker. "Recent" currently means "within the last 14 days". But, that 14 day interval can be tweaked. So, if a demo gets a lot of likes & launches over 2 weeks, it will bubble up in the sort order. If likes and launches die off, it will drop down as the 2 week window moves on and older likes/launches are no longer counted. To maintain the counters, we'll need a new cron job running regularly (eg. daily or hourly). Something like this kicks it off: python2.6 ./manage.py cron update_actioncounter_counts lcrouch: I don't see a cron script under scripts, so I'm guessing this is an IT bug as a next step?
this is done, yeah?
Just realized that we probably never set up the cron job to update recent counts for likes and launches that up-and-coming sort depends on. Filed an IT bug to make that happen.
adding raymond so he can verify once IT sets up the cron
Looks like the crontabs are setup per bug 667633. This might be odd to verify, but here are some hints... This page is an example of the home page with the sort: https://developer.mozilla.org/en-US/demos/all/?sort=upandcoming Demos are sorted by likes, followed by launches, limited to a 2-week window. These recent counts are not displayed anywhere on the page, but I have included them in the source code. If you view source or inspect element with Firebug, you should find data-recent="..." attributes on stats for individual demo thumbnails. These numbers should be equal-to or less than the lifetime total in the respective list item. In fact, the older a demo is, the lower the recent number should be when compared with the lifetime total. That's assuming attention on older demos drops off in favor of newer demos, and so recent likes/launches drop off over a 2 week window.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Version: MDN → unspecified
Component: Demos → Demo Studio / Dev Derby
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.