Skip to content

eads/newslynx-core

 
 

Repository files navigation

newslynx

This is still a WIP and we should be officially open-sourcing the codebase in late June/July 2015. For now, please read the report we published for the TowCenter on our prototype.

(Re)Setting up the dev environment

Install newslynx, prefrerably in a virtual environment.

git clone https://github.com/newslynx/newslynx.git
cd newslynx
python setup.py install

If you want to actively work on the codebase, install in editable mode:

git clone https://github.com/newslynx/newslynx.git
cd newslynx
pip install --editable . 

Install the dependencies (instructions for Mac OS X, for now):

Install redis:

brew install redis

NOTE We recommend using Postgres APP. However, if you prefer the brew distribution, make sure to install it with plpythonu.

brew install postgresql --build-from-source --with-python

(Re)create a postgresql database

dropdb newslynx 
createdb newslynx

Set your configurations

Start the redis server

Open another shell and run:

redis-server

Initialize the database, super user, and instlald built-in sous chefs.

newslynx init

Start the server

  • In debug mode: newslynx debug
  • Debug mode with errors: newslynx debug --raise-errors
  • Production gunicorn server: ./run

Start the task workers

./start_workers

stop the tasks workers

./stop_workers

IGNORE THIS ERROR:

This is a result of our extensive use of gevent. We haven't yet figured out how to properly suppress this error. See more details here.

Exception KeyError: KeyError(4332017936,) in <module 'threading' from '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.pyc'> ignored

TODO

  • Fix Bulk Loading process.
  • Implement Reports API
  • Re-implement SousChefs
    • RSS Feeds => Thing
    • Google Analytics => Metric
    • Google Alerts => Event
    • Social Shares => Metric
    • Homepage Promotions => Metric
    • Twitter Promotions => Metric
    • Facebook Promotions => Metric
    • Twitter List => Event
    • Twitter User => Event
    • Facebook Page => Event
    • Reddit => Event
    • HackerNews => Event
  • Implement New SousChefs
    • IFTTT integrations
      • Wordpress Publish => Thing
      • TK
    • Regex Thing URL => Tag
    • Search Things => Tag
    • Meltwater Emails => Event
    • Newsletter Email Promotions => Metric
    • Calculated Metric? SQL API.
  • Implement Recipe scheduler
  • Implement Admin Panel
  • Migrate Core Prototype Users.
  • Automate Deployment
  • App Integration
  • Document, Document, Document

References

API Design

Crosstab in Postgres

filling in zeros for a timezeries

fetching column names from table

timeseries tips

Getting bigger with flask (+ dynamic subdomains):

Nonblocking with flask, gevent, + psycopg2

Rate Limiting in Flask.

Postgres Search Configuration

License

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

About

The API and Data Collection Tasks That Power NewsLynx

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.7%
  • HTML 3.0%
  • Other 1.3%