Gobo is a responsive web-based social media aggregator with filters you can control. You can use Gobo to control what’s edited out of your feed, or configure it to include news and points of view from outside your usual orbit. Gobo aims to be completely transparent, showing you why each post was included in your feed and inviting you to explore what was filtered out by your current filter settings.
Try it out at https://gobo.social.
Gobo is a project of the MIT Center for Civic Media, at the MIT Media Lab. It was created by Jasmin Rubinovitz, Alexis Hope, Rahul Bhargava and Ethan Zuckerman, with generous support from the Knight Foundation.
Gobo uses Python 2.7.x.
server/config/ using the provided template to hold the right api keys and database url.
We manage different versions with pyenv. Install this with HomeBrew:
brew update brew install pyenv
Then install the versions of Python we need:
pyenv install 2.7.10
For managing a virtual enviromnent with a specific version of python for our project, we use pyenv-virtualenv. Install this with homebrew as well
brew install pyenv-virtualenv
As noted in their readme, you'll need to add these two lines to your
.bash_profile file (or you
.profile file). Then open a new terminal session:
eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)"
And then create a virtualenv for this project. The name is important, because the
refers to it so it loads automatically when you enter the directory (if
eval "$(pyenv virtualenv-init -)"
is in your
pyenv virtualenv 2.7.10 gobo
Requirements and Database
Install all requirements:
$ make requirements-local.py
To set up the database run:
$ export FLASK_ENV=dev $ make db-setup
In another terminal window, cd to
If you haven't already, install Node Version Manager.
Install and use version node version 10.13.0:
$ nvm install 10.13.0 $ nvm use 10.13.0
Install requirements and build static assets:
$ npm install $ npm run build
In development mode Gobo has multiple pieces you need to run:
- The Flask server handles authentication and interactions between the client and the various APIs.
- The Redis queue holds jobs for analyzing content with the plug-in algorithms, and requests to fetch posts.
- Celery runs the workers to do things in the queue.
- We use npm to run the front-end React code that drives the UI.
Run the Flask server locally:
In order to fetch posts from FB and Twitter you need to run the redis-server and celery worker locally. Open 2 new shell terminals, and activate the virtualenv. Then run:
And in the other one:
$ source venv/bin/activate $ celery -A server.scripts.tasks worker
In another terminal window open cd to
/client and then:
$ nvm use 10.13.0 $ npm start
After that you should be able to see Gobo at localhost:5000
You need to set up three recurring tasks. The first adds tasks to the queue to fetch FB and Twitter posts for users that have been using the system recently. Run this every hour or so:
$ python -m server.scripts.queue_prioritized_user_posts
The second updates the posts from news organizations (used for the "perspectives" filter). Run this every 6 hours or so:
$ python -m server.scripts.queue_latest_news_posts
The third removes old posts (Gobo only tracks the posts within the last two weeks). Run this once a night:
$ python -m server.scripts.delete_old_posts
To delete a specific user:
$ python -m server.scripts.delete_user [user_id]
Documentation and tasks for creating and sharing rules found via the flask CLI:
You can choose to only allow signup to people that have a special password. Add the following vars in
LOCK_WITH_PASSWORD = True BETA_PASSWORD = 'password_you_want'
To remove the password just set
LOCK_WITH_PASSWORD = False.
Set up Google Analytics:
Edit the GA ID in
When updating models that result in a table change (e.g. column added/removed), generate migrations with:
$ flask db migrate
This will generate a new migration file in
migrations/versions that should be added to version control.
Gobo is set up to deploy to containerized hosts like Heroku or Dokku. Typically configuration is done with environment variables. For now we've got a system that involves editing the config file on a local branch. We'll get around to changing this eventually.
- Create a new local branch called "deploy":
git checkout -b deploy
- Create a new app on the Heroku website, or with the command line in Dokku
- Add the heroku/dokku remote to the GitHub repo
- In "deploy" branch, edit
.gitignoreto not ignore config.py (make sure to also save a copy of config.py somewhere else on your computer)
- On your host (Heroku/Dokku), add a database and a redis instance
config.pyin the deploy branch to match the database and redis url
- Push to that deploy remote:
git push deploy deploy:master
!!! - Make sure to not push this branch anywhere else!! as this contains sensitive data! - !!!
client/app/constants/index.js and bump up the semantic version number before every release. This shows up at the bottom of the About page.
$ npm run lint_fix
Not all errors can be fixed this way and for more details about the linting error see eslint.