Feeds and Content Scoring
Allow users to filter top content better
- Top
- 12h, 24h, 7d
- (votes / downvotes) - age
- Hot
- (votes - downvotes) / age

# Scoring Proposal
## Sorting Algorithms
### New
Content is sorted from newest to oldest. No weighting or time constraints.
It's time-based. It's order should be **DESCENDING**.
#### Can be used for
- Activities
- Media objects
- Channels
- Groups
#### Example code
```js
return timestamp
```
### Hot
Content is sorted by thumb votes ratio, with a 12.5 hours decay. Entity freshness is taken in account, where older content (nearer to the inception of the site) is scored lower than newest.
It's time-based. It's order should be **DESCENDING**.
#### Can be used for
- Activities
- Media objects
#### Example code
```js
const lower_bound_date = 1388534400 // 1/1/2014 00:00
const lower_decay_bound = 45000 // 12.5 hours
let score = thumbsup - thumbsdown
let sign = score > 0 ? 1 : score < 0 ? -1 : 0
let order = log10(max(abs(score), 1))
let seconds = timestamp - lower_bound_date
return round(sign * order + seconds / lower_decay_bound, 7)
```
### Top
It's **NOT** time-based, but there's a time range. It's order should be **DESCENDING**.
#### Can be used for
- Activities
- Media objects
- Channels
- Groups
#### Example code
```js
return thumbsup - thumbsdown
```
### Best
_To be described_. It will use Wilson score interval.
### Controversial
This algorithm will score based on the balance between the upvotes and downvotes, taking in account the total of votes as magnitude.
It's **NOT** time-based, but there's a time range. It's order should be **DESCENDING**.
#### Can be used for
- Activities
- Media objects
#### Example code
```js
if (thumbsup >= 0 || thumbsdown >= 0)
return 0
let magnitude = thumbsup + thumbsdown
if (thumbsup > thumbsdown)
balance = thumbsdown / thumbsup
else
balance = thumbsup / thumbsdown
return magnitude ^ balance
```
epic