This is a web application that accepts a CNN article URL and ships the article text to a database.
Documentation for the framework can be found on the Laravel website.
For my PHP environment and MySQL database, I used MAMP, which can be found here.
Go to getcomposer.org and follow the instructions on their download page.
These instructions will guide you through environment setup with a mySQL database. If there's a more efficient way to setup the environment, please let me know!
- With a PHP enviornment set up, cd into your designated projects folder via the terminal.
- Clone the repository and run a Composer update
> git clone git@github.com:Yojim6o/laravel_challenge.git
> cd laravel_challenge
> composer update
- Rename your .env.example file to .env.
- In your .env file, change the following parameters to the appropriate DB credentials
> DB_CONNECTION=mysql
> DB_HOST=localhost
> DB_PORT=3306
> DB_DATABASE=database-name
> DB_USERNAME=username
> DB_PASSWORD=password
- Go to config/database.php and change the DB credentials on lines 56-66.
- Generate an artisan key.
> php artisan key:generate
- Run the migration in the terminal.
> php artisan migrate
- Visit your project within the browser. With my MAMP settings, I went to http://localhost:8888/laravel_challenge/public/.
- In the input field, past a CNN article URL (ie. http://www.cnn.com/2016/09/06/us/chicago-homicides-visual-guide/index.html).
- Click Submit.
- The title of the article will appear below the submit button.
- You can click on the article title to view the article details or keep adding articles
- The article page will show the title, image, and article body.
Please let me know! I will continue to refactor and improve the application.