|
|
|
# Getting started #
|
|
|
|
## Prerequisites ##
|
|
|
|
|
|
|
|
- python >= 2.7
|
|
|
|
- pip
|
|
|
|
- mongodb
|
|
|
|
- virtualenvwrapper or virutalenvwrapper-win if on windows (optional but highly recommended)
|
|
|
|
|
|
|
|
## Installation ##
|
|
|
|
### Creating the environment ###
|
|
|
|
Create a virtual python environment for the project.
|
|
|
|
If you're not using virtualenv or virtualenvwrapper you may skip this step.
|
|
|
|
|
|
|
|
#### For virtualenvwrapper ####
|
|
|
|
```bash
|
|
|
|
mkvirtualenv --no-site-packages twitter-env
|
|
|
|
```
|
|
|
|
|
|
|
|
#### For virtualenv ####
|
|
|
|
```bash
|
|
|
|
virtualenv --no-site-packages twitter-env
|
|
|
|
cd twitter-env
|
|
|
|
source bin/activate
|
|
|
|
```
|
|
|
|
|
|
|
|
### Clone the code ###
|
|
|
|
Obtain the url to your git repository.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone git@source.ijs.si:jkranjc/twitter.git twitter
|
|
|
|
```
|
|
|
|
|
|
|
|
### Install requirements ###
|
|
|
|
```bash
|
|
|
|
cd twitter
|
|
|
|
pip install -r requirements.txt
|
|
|
|
```
|
|
|
|
|
|
|
|
### Copy and edit the settings file ###
|
|
|
|
```bash
|
|
|
|
cp __settings.py settings.py
|
|
|
|
vi settings.py
|
|
|
|
```
|
|
|
|
|
|
|
|
## Show help text ##
|
|
|
|
```bash
|
|
|
|
python search.py -h
|
|
|
|
```
|
|
|
|
|
|
|
|
## Executing a query ##
|
|
|
|
```bash
|
|
|
|
python search.py -q "miley cyrus" -v DEBUG
|
|
|
|
```
|
|
|
|
|
|
|
|
## Running as a daemon ##
|
|
|
|
|
|
|
|
The supervisord.conf file is there to serve as a sample configuration file for supervisor. You can use it if you find it sufficient. Just edit it to change the query.
|
|
|
|
|
|
|
|
Afterwards you can start the daemon like this (you must be in the same folder as supervisord.conf or your supervisord.conf must be /etc/
|
|
|
|
|
|
|
|
```bash
|
|
|
|
supervisord
|
|
|
|
```
|
|
|
|
Open your browser to 127.0.0.1:9001 to see the status of the daemon.
|
|
|
|
By default the username is manorastroman and the password kingofthedragonmen. |
|
|
|
\ No newline at end of file |