Hacker News clone in PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
core First commit of HackerNews clone in PHP Mar 17, 2015
templates/stanley First commit of HackerNews clone in PHP Mar 17, 2015
.gitignore
LICENSE Added README & LICENSE Mar 17, 2015
README.md Added screenshots Mar 17, 2015
add_story.php First commit of HackerNews clone in PHP Mar 17, 2015
composer.json
composer.lock First commit of HackerNews clone in PHP Mar 17, 2015
config.ini.template
cron.php Added README & LICENSE Mar 17, 2015
index.php First commit of HackerNews clone in PHP Mar 17, 2015
install.php Fixed installation script Mar 17, 2015
login.php First commit of HackerNews clone in PHP Mar 17, 2015
logout.php
profile.php First commit of HackerNews clone in PHP Mar 17, 2015
search.php First commit of HackerNews clone in PHP Mar 17, 2015
signup.php First commit of HackerNews clone in PHP Mar 17, 2015
story.php First commit of HackerNews clone in PHP Mar 17, 2015
vote.php

README.md

Hacker News clone in PHP

This is a clone of Hackernews written in PHP.

Features

  • Submit stories or ask questions.
  • Recursive comments
  • Vote on questions and comments
  • Stories are ranked based on user votes using an algorithm similar to hacker news ranking.

Screen shots

Front Page

Front Page

Comments

Comments

System Requirements

This has been tested on

  • PHP >= 5.2.X
  • MySQL >= 5.6

##Installation

Installation requires access to a command line.

  • Clone/download the repository
  • Install dependencies
composer install
  1. Rename config.ini.template to config.ini
  2. Update config.ini with your database information
  • Make sure the database already exists (this installation does not create the database)
  • Make sure the db user has permission to create tables.
  1. execute php install.php
  2. edit your crontab and add cron.php to execute every 30minutes.
  • Open crontab for editing
crontab -e

Add this line, with ABSOLUTE_PATH_TO_INSTALL_FOLDER set correctly.

*/30 * * * * php /ABSOLUTE_PATH_TO_INSTALL_FOLDER/cron.php
  1. goto http://{{YOUR_WEBSITE}}/signup.php and create a new user:
  2. Done. Start creating stories.

To Do

  • Rank comments using the same time weighted algorithm as stories
  • Change comment table structure to make it more efficient.

License

Hackernews is released under the MIT License. See LICENSE file for details.