{"id":22769832,"url":"https://github.com/bfontaine/blabbr","last_synced_at":"2025-04-15T03:20:35.021Z","repository":{"id":57415487,"uuid":"70937588","full_name":"bfontaine/blabbr","owner":"bfontaine","description":"Twitter bot","archived":false,"fork":false,"pushed_at":"2019-10-03T17:49:00.000Z","size":50,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T06:20:45.240Z","etag":null,"topics":["bot","python","twitter"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bfontaine.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-14T18:38:26.000Z","updated_at":"2021-11-05T08:27:33.000Z","dependencies_parsed_at":"2022-08-27T18:10:26.788Z","dependency_job_id":null,"html_url":"https://github.com/bfontaine/blabbr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fblabbr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fblabbr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fblabbr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfontaine%2Fblabbr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfontaine","download_url":"https://codeload.github.com/bfontaine/blabbr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248997340,"owners_count":21195861,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","python","twitter"],"created_at":"2024-12-11T15:16:03.546Z","updated_at":"2025-04-15T03:20:35.001Z","avatar_url":"https://github.com/bfontaine.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blabbr\n\n`blabbr` is a bot that tweets randomly-generated texts using\n[Markov chains][markovify].\n\n[markovify]: https://github.com/jsvine/markovify\n\n## Setup\n\n    pip install blabbr\n\nThen follow the interactive setup:\n\n    blabbr setup\n\nYou can also initialize a configuration file with `blabbr config init` then\nfill it by hand. Check the _Config_ section below for more info.\n\n## Run\n\nRunning a bot with `blabbr` is done in two steps: first, feed the model. Then,\nuse that model to generate tweets.\n\nYou can feed your model either from Twitter using a few users as a seed or from\na file that contains one tweet per line:\n\n    # feed from Twitter\n    $ blabbr populate\n\n    # feed from a file\n    $ blabbr populate --from-raw mytweets.txt\n\nYou can also retrieve tweets in a file instead of feeding them directly to the\nmodel. This is useful in combination with `--from-raw` to check the tweets\nbefore feeding them:\n\n    # append tweets to tweets.txt, one per line\n    $ blabbr populate --raw tweets.txt\n\nBy default the model is stored in `blabbr.json` in the current directory. You\ncan change that by using the `--model` option:\n\n    $ blabbr --model mymodel.json populate\n\nPopulating an existing model doesn’t erase its previous content.\n\n---\n\nOnce you’re happy with your model run it:\n\n    blabbr run\n\nThe default bot follows a few rules to behave well with its human friends:\n\n* It doesn’t tweet during the night\n* It tweets less during work hours\n* It never tweets more than twice in a couple of minutes\n\n### Config\n\nA bot needs a configuration file to run. By default it tries to find\n`blabbr.cfg` in the current directory and fallback on `~/.blabbr.cfg`. You can\ngive a custom path with `--cfg \u003cpath\u003e`.\n\nThe default config file looks like this:\n\n```ini\n[seeds]\nscreen_names = \n\n[auth]\ntoken = \nconsumer_secret = \nconsumer_key = \ntoken_secret = \n\n[bot]\ntimezone = Europe/Paris\nlang = en\n```\n\n* `seeds.screen_names` should be a comma-separated list of Twitter usernames.\n  Those are used as seeds to retrieve tweets. By default it fetches their last\n  1000 tweets then check 10 of the users they follow and so on. See\n  `blabbr populate --help` for more info on how to change that behavior.\n* `auth.token` and similar keys are needed for the Twitter API. Run\n   `blabbr setup --help` for more info.\n* `bot.timezone` is the bot’s timezone. This is important so that it doesn’t\n  tweet in the middle of the night.\n* `bot.lang` is used to filter tweets when populating the model.\n* `bot.follow` and other boolean options are flags to enable/disable some of\n  the bot's actions. Right now only the `tweet` feature is implemented.\n\nA few more variables can be set:\n\n* `bot.screen_name`: Your bot's screen name. It’ll be automatically set if you\n  use `blabbr setup`. This is used to save an API call when the bot needs to\n  know its own name, in order to e.g. filter out its own tweets from its home\n  timeline.\n\nYou can print your configuration with `blabbr config`. Use `--cfg` to specify\nanother path:\n\n    $ blabbr --cfg ~/.config/blabbr.cfg \u003ccommand\u003e [options...]\n\nCheck your authentication configuration with `blabbr setup --check`.\n\n### Limitations\n\nThe most notable limitation right now is that you have to build the model\n_before_ running the bot. It’d be a lot more interesting if it could feed its\nmodel in (near-)real-time.\n\nAdditionally, I made this toolkit for my own usage and thus it’s best suited\nfor tweets in French. It’ll work for other languages but the text cleaning step\nwon’t be as good.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfontaine%2Fblabbr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfontaine%2Fblabbr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfontaine%2Fblabbr/lists"}