Giter Site home page Giter Site logo

lugawi / crabber Goto Github PK

View Code? Open in Web Editor NEW

This project forked from crabber-net/crabber

0.0 0.0 0.0 37.64 MB

A Twitter clone written in Python + Flask with extended features and a focus on inclusivity.

Home Page: https://crabber.net

License: GNU General Public License v2.0

Python 26.02% CSS 6.18% HTML 37.23% Shell 0.04% JavaScript 15.99% Jinja 0.11% Dockerfile 0.04% Makefile 0.03% Rich Text Format 14.36%

crabber's Introduction

crabber A Twitter clone for crabby people.


Screenshots

Dark Mode

screenshot of crabber.net dark mode

Light Mode

screenshot of crabber.net light mode

Advantages

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:

  • Completely open-source and a light codebase. If you have problems you can fix those problems yourself and even host your own instance of the site.
  • The ability to edit posts for up to five minutes after they are posted.
  • A full, open REST API with an officially maintained Python client. There are no paywalls or massive hoops to jump through in order to use this unlike Twitter's API.
  • Much greater privacy and absolutely no tracking.
  • No sponsored posts or other advertisements (or anything else relating to finance).
  • Proper rules and moderation preventing misinformation and hate speech. (Admittedly, this is simply impossible for Twitter due to its astounding scale. They still lack this nonetheless.)
  • Better user page and bio customization.

Installation

  1. Clone the repo
git clone https://github.com/crabber-net/crabber.git
cd crabber
  1. Install dependencies (requires Poetry)
poetry install
poetry shell
  1. (Optional) Download the GeoLite2 City database from [MaxMind] (https://dev.maxmind.com/geoip/geolite2-free-geolocation-data?lang=en) saved as GeoLite2-City.mmdb in the project root to enable location bans.
  2. (Optional) Add configuration variables to your environment with a .env file or through other means.
  3. Set up the database
python scripts/initialize_database.py
  1. (Optional) If you want OpenGraph cards you need to set up a cron job that runs 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.

Captcha

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.

Running

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.

API

REST

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!

Python

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!')

crabber's People

Contributors

jakeledoux avatar dependabot[bot] avatar opcivy avatar greysdawn avatar dbtderpbox avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.