This project has been developed in response to the newspaper request to analyse their articles and authors based on logs.
These instructions will help you out to run this code on your local machine.
- Download and install Vagrant 2.2.0
- Download Vagrantfile and install the virtual box:
$ git clone https://github.com/udacity/fullstack-nanodegree-vm.git FSND_VM
$ cd FSND_VM/vagrant
$ vagrant up
Depends on your internet speed, the
vagrant up
command will take a few minutes, be patient :)
- Download the database file, unzip it, then delete the unneeded zip file:
$ curl -L https://github.com/mtawil/logs-analysis/files/2498083/newsdata.zip > newsdata.zip
$ unzip newsdata.zip && rm -f newsdata.zip
Make sure that you've downloaded it on the same vagrant directory so that it can be accessible inside the virtual box.
- First of all, let's log into the virtual box using
vagrant ssh
, after that, go to the shared directory inside the virtual boxcd /vagrant
. - Clone this repo into the shared directory:
$ git clone https://github.com/mtawil/logs-analysis.git /vagrant/logs-analysis
Please make sure you're on the shared directory and all the listed files as below are presented:
- Import the database:
psql -d news -f newsdata.sql
- Install the project requirements:
$ pip3 install -r requirements.txt
The output you get should be like this:
After you successfully installations, you can run this code by:
$ python3 main.py
The output results should be like the below screenshot
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
This project use SemVer for versioning. For the versions available, see the tags on this repository.
- Mohammad AlTaweel - Initial work - mtawil
This project is licensed under the MIT License - see the LICENSE.md file for details