give texts give poems
SQL Other
Switch branches/tags
Nothing to show
Latest commit 1686398 May 17, 2014 @pietdaniel Merge pull request #2 from pietdaniel/refactorings
further removal of dead code, general cleaning and grokings


####Give me text, get poems A simple hack project built at HackBeanPot 2014. It uses natural language processing to pull an oauth'd users tweets, facebook posts, or github commits.


First install the basic dependencies.

sudo apt-get install python
sudo apt-get install nginx
sudo apt-get install git
sudo apt-get install build-essential python-dev

Get pip going,


Django setup:

sudo pip install Django

Dependencies for the project:

sudo pip install django-social-auth
export PYTHONPATH=$PYTHONPATH:$(pwd)/django-social-auth/
sudo apt-get install python-oauth2
sudo apt-get install python-openid
sudo pip install twython

Get numpy, nltk, nltk_contrib

sudo pip install -U numpy
sudo pip install -U nltk
sudo python install

Download cmudict:

>>> import nltk
>>> b # download
>>> cmudict # cmudict

Set up a site-enabled config:

server {
    listen 80;
    access_log /var/log/nginx/poetification.access.log;
    error_log /var/log/nginx/poetification.error.log;

    location /static/ {
        alias /home/poetification/poetification/poetification/webpoet/static/;
        expires 30d;

    location / {
        include fastcgi_params;
        fastcgi_split_path_info ^()(.*)$;

If all went well start up fcgi

python ./ runfcgi host= port=8080

Some enviroment variable will need to be set, they are keyed as follows:

export P_APP_KEY='#{twitter_app_key}'
export P_APP_SECRET='#{twitter_app_secret}'
export P_OAUTH_TOKEN='#{twitter_oauth_token}'
export P_OAUTH_SECRET='#{twitter_oauth_secert}'
export FACEBOOK_APP_ID='#{facebook_app_id}'
export FACEBOOK_API_SECRET='#{facebook_api_secret}'
export GITHUB_APP_ID='#{github_app_id}'
export GITHUB_API_SECRET='#{github_api_secret}'

and run the server

python runserver