A Twitter clone for crabby people.
Beyond the novelty of "twitter but crab" as Crabber user @tuna so eloquently put it, there are a number of advantages Crabber has over Twitter. Here are a few:
git clone https://github.com/crabber-net/crabber.git
cd crabber
poetry install
poetry shell
GeoLite2-City.mmdb
in the project root to enable location bans..env
file or through other means.python scripts/initialize_database.py
fetch_cards.py
periodically.
crontab -e
This will open your crontab file in $EDITOR. If you're not sure how crontabs work, add this line:
* * * * * cd CRABBERDIRECTORY && poetry run python fetch_cards.py
This will run fetch_cards.py
in your Crabber virtual environment once every
minute. To run every five minutes change the first asterisk to 0/5
. Learn
about crontabs if you wish to make further adjustments.
Crabber has the option of using an invisible captcha on the signup page to
help prevent bots and spam, to enable this, set the HCAPTCHA_ENABLED
to True
in config.py
, and set the HCAPTCHA_SITE_KEY
and HCAPTCHA_SECRET_KEY
environment variables to your site and secret key respectfully.
Simply run crabber.py
in your configured environment and open localhost
in
your browser, you can specify a port for the development server to run on by
setting the PORT
environment variable, it defaults to port 80 if not set.
PORT=1024 python crabber.py
This gets you a development server but should not be used in production. Install a "real" server like Apache2, Nginx, etc.
Crabber has a REST API mounted at /api/v1
using the
crabber_api.py blueprint. Documentation is available
here.
If you are interested in contributing to the documentation please create an issue to let us know, any help is appreciated!
A Python library has been written to simplify interaction with the site's API and make developing bots and other applications more fun.
You can find that library here on PyPi and its repo here.
pip install python-crabber
import crabber
api = craber.API(YOUR_API_KEY,
YOUR_ACCESS_TOKEN)
jake = crabber.get_crab_by_username('jake')
jake.follow()
molt = jake.get_molts()[0]
molt.like()
molt.reply('Wow, you\'re so cool!')