RandomGit.com - A website to discover new GitHub repositories
NOTE: The site is down because of the lack of traffic. I'm still keeping the code here for future reference or for somebody to pickup the project.
I need your help to make a better RandomGit.com!
All you need is in the setup folder
- Install a HTTP server with PHP and MySQL
- Create a database and import
schema.sqlin it - Fill
config.phpwith the database credentials and move it tosrc/config.php - Set a cron job to execute
src/job/updateCache.phpevery 5 minutes
- Optimize database transactions in
src/lib/RepoCache.php - Beautify index.php
- Repository filtering (number of stars/forks, ...)
- Your idea!
Each 5 minutes, updateCache.php generates a random alphanumeric string of 2 characters. Then it uses the GitHub Search API to find repositories by using the random string as the query and it stores them (with their readme) in the database. Then, index.php does a request to ajax/random.php to get a list of random repositories from the database and displays their readme to the user. When the database becomes really big, updateCache.php removes a bunch repositories from the database.
I you have any question, create an issue with the question tag.
See LICENSE