2017 © Pedro Peláez
 

library decay

Famous sorting algorithms based on vote popularity and time implemented for PHP

image

mtasuandi/decay

Famous sorting algorithms based on vote popularity and time implemented for PHP

  • Sunday, November 1, 2015
  • by mtasuandi
  • Repository
  • 1 Watchers
  • 2 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Build Status, (*1)

Decay

Famous sorting algorithms based on vote popularity and time implemented for PHP., (*2)

Installation

composer require mtasuandi/decay dev-master

Usage

<?php
use Mtasuandi\Decay\Decay;

$c = new Decay();

$decay = 45000;
$ups = 10;
$down = 100;
$date = '2015-11-01 01:01:01';

$gravity = 1.8;
$votes = 100;

$z = 1.96;

/**
 * Reddit
 */
$redditHot = $c->redditHot( $decay, $ups, $down, $date );
echo $redditHot . "\n";

/**
 * Hacker News
 */
$hackerHot = $c->hackerHot( $gravity, $votes, $date );
echo $hackerHot . "\n";

/**
 * Wilson Score
 */
$wilsonScore = $c->wilsonScore( $z, $ups, $down );
echo $wilsonScore;

License

The MIT License (MIT)., (*3)

The Versions

01/11 2015

dev-master

9999999-dev https://github.com/mtasuandi/decay

Famous sorting algorithms based on vote popularity and time implemented for PHP

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

decay sorting algorithms