Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
locally fetch, store, and present social media flux
Python JavaScript
tag: 0.2.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
docs
example_project
flux
.gitignore
.hgignore
.hgtags
LICENSE.rst
MANIFEST.in
README.rst
REQUIREMENTS
setup.py

README.rst

Here's the situation. You're on a website that you think is pretty cool and you think it may be worth following them on Twitter (or RSS, Facebook, Google+, etc). You hesitate. Will you be inundated with irrelevant content?

Although this information is readily available and often a click or two away, these additional clicks create an unnecessary barrier to entry. The goal of flux is to make it possible to quickly assess the utility of following a particular feed of content and whether the flux of relevant content will be useful for you. Currently, flux supports:

Quick start

  1. Install flux with pip:

    [shell]$ pip install django-flux
    
  2. Add flux to the INSTALLED_APPS <https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps> in settings.py of your django project:

    INSTALLED_APPS += ('flux', )
    
  3. Run syncdb to create the necessary tables:

    [shell]$ python manage.py syncdb
    
  4. Make sure the admin is enabled on your site and add accounts to monitor by visiting the admin page of your site (e.g., http://localhost:8000/admin/flux/account/add)

  5. Run the update_flux management command:

    [shell]$ python manage.py update_flux
    
  6. Use the flux_timeseries template tag on Account instances (account below) in your templates:

    <link rel="stylesheet" href="{{STATIC_URL}}flux/css/timeseries.css" />
    
    {% load flux %}
    {% flux_timeseries account %}
    

    and you should see something like this:

    default flux timeseries view
  7. Customize the styling and layout by altering the CSS, and content accordingly

Options

Labels on mouseover with bars

Optionally include labels for the bars with d3.js by including the following in your templates:

<link rel="stylesheet" href="{{STATIC_URL}}flux/css/timeseries.css" />
<link rel="stylesheet" href="{{STATIC_URL}}flux/css/bar_mouseover_labels.css" />

{% load flux %}
{% flux_timeseries account %}

<script src="//d3js.org/d3.v2.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="{{STATIC_URL}}flux/js/bar_mouseover_labels.js"></script>

and you should see something like this:

labelled bars in the timeseries view

Sparklines

Optionally include sparklines with d3.js by including the following in your templates:

<link rel="stylesheet" href="{{STATIC_URL}}flux/css/timeseries.css" />
<link rel="stylesheet" href="{{STATIC_URL}}flux/css/sparkline.css" />

{% load flux %}
{% flux_timeseries account %}

<script src="//d3js.org/d3.v2.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="{{STATIC_URL}}flux/js/sparklines.js"></script>

and you should see something like this:

sparkline view

Production usage

To have the feeds monitored be continuously updated, add the following line to your crontab:

0 0 * * * /path/to/manage.py update_flux

Contribute!

  1. Clone the code from github
  2. Setup the virtualenv by following the instructions in example_project/virtualenv_requirements.txt
  3. Edit, test, and share your code. See the issues page for inspiration.
Something went wrong with that request. Please try again.