A little web app that remixes Dinosaur Comics.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
cli
doc
public
templates
test
.gitignore
.travis.yml
LICENSE.md
README.md
composer.json
composer.lock
composer.phar
deploy.php
deployer.phar
package-lock.json
package.json

README.md

Dinosaur Remix Build Status License

Dinosaur Remix is a web page that takes Dinosaur Comics and remixes them randomly, hopefully in interesting ways. It uses PHP, Python, and jQuery to do its remix-o-matic dance.

You can see it here: http://dinoremix.definingterms.com/

Using

If you want to host your own Dinosaur Remix page, just get a copy of the source and point your web server to the public directory. Make sure your web server is set up to run PHP scripts from this directory and that unknown URLs will be redirected to index.php. In nginx you can do so with this config snippet:

location / {
    try_files $uri $uri/ /index.php$is_args$args;
}

Before the site will work, you will need to run ./composer.phar install --no-dev from the command line within the root directory of the repository.

Then, run python cli/downloadComics.py to download the comics from the Dinosaur Comics site and divide them into panels. You can set up a cron job to do this daily if you want it to always be up-to-date.

Requirements

The code requires PHP 7.0+ and Python 2.7 or 3.

The Python scripts require the Python Image Library module. On Ubuntu systems, you can install the module with this console command:

sudo apt-get install python2.7-pil

Or, for Python 3:

sudo apt-get install python3-pil

The BeautifulSoup module is also required. It can be installed with pip:

sudo pip install beautifulsoup

Deploying

A deploy script is already set up to use Deployer, but you will need to customize it for your server. First, edit deploy.php and change the server() details. Once you have customized the configuration, run this command to deploy:

$ php deployer.phar deploy production

Development

The PHP extensions dom, simplexml, and mbstring are required for the development scripts. After installing them, you should run php composer.phar install.

The PHP code is written to comply with PSR1 and PSR2. A composer script to verify the conformance to those style guides with PHP_CodeSniffer can be run with:

php composer.phar check-style

If there are any problems that can be fixed automatically by PHPCBF, you can fix them with this command:

php composer.phar fix-style

There are automated tests in the test directory. They can be run with this command:

php composer.phar test

Minification of the frontend assets happens during deploy. To run it locally, run npm install and npm run build. If there are minified files in public/assets/dist, then those will be served to the browser instead of the source files.

License

This code is free software licensed under the GPL 2. See the LICENSE.md file for details.