hnapp is a search engine for Hacker News that lets you subscribe to new search results via RSS or JSON. You would use it to keep in the loop about your favourite technologies, keep an eye on mentions of your product, filter out politics, or follow what your friends are talking about. See hnapp.com for more examples.
This repository contains the source code for all of hnapp, including the website hnapp.com.
python
2.7/2.8, python-dev
, virtualenv
, setuptools
postgresql
, postgresql-common
, libpq-dev
nodejs
, npm
, bower
requirements.txt
for piphnapp was tested in the following environment:
nginx
+ uwsgi
combo for production, or Flask's built-in web server for developmentsudo su - postgres
psql -U postgres -c "CREATE USER hnapp WITH PASSWORD 'new_password'"
psql -U postgres postgres -f /srv/www/hnapp/sql/initial_schema.sql
psql -U postgres postgres -f /srv/www/hnapp/sql/migration_001.sql
psql
\c hnapp
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES in schema public TO hnapp
INSERT INTO status (name, number) values ('last_item_id', XXXXXXX)
Where XXXXXXX is the id of the first HN item you want hnapp to download. Don't set it too far in the past, you can always download more items later.
pip install -r requirements.txt
cp config.sample.py config.py
nano config.py
vpython /srv/www/hnapp/cron.py every_1_min
every minute (replace vpython
with the path to the python binary in your virtual environment). You should redirect all output to a log file to log errors.static
must be webroot. hnapp was tested with nginx
and uwsgi
. The uwsgi application is app
in run.py
. For development purposes, you can use Flask's built-in web server by running vpython run.py
MIT License, see LICENSE.md
For bug reports and feature requests, please open an issue on github.
Nikita Gazarov