Skip to content

0x80085/elixir-fedi-bot

Repository files navigation

Fediverse Bot

Make sure you have created a PostgreSQL DB with credentials found in config/dev.exs.

To start your Bot / Phoenix server:

  • Run mix setup to install and setup dependencies
  • Start Phoenix endpoint with mix phx.server or inside IEx with iex -S mix phx.server

Now you can visit localhost:4000 from your browser.

To connect the bot to your any Mastodon account

Features

  • Scrapes RSS feeds and posts
  • Control your bot from the browser
  • Mastodon & Pleroma support
  • Manually post toot + image
    • Preview toot before posting (does not contain full featuresof a regular toot)
  • 1 bot per fedibotchan process/DB
  • Multiple RSS feed support
  • Bot statistics
    • avg % of amount of toots per hour
    • amount of favs, retoots, comments last 24 hours
    • follower count
    • account age
    • total toot count
    • total toot count
  • Real time visual log of RSS scrape results
  • Configurable RSS scrape job settings
    • max_post_burst max # toots per URL scrape job (e.g. if max_post_burst is 5 and there are 7 new posts for example.com/rss, it wil post the 5 most recent ones)
    • Scrape job interval in (scrape every x minutes)
    • Max age of RSS item (e.g. can't be posted more than x minites ago)
    • Dry run mode: prints toots to terminal output instead of posting

Todo

  • Persist tokens gotten from fedi
  • Post text + image
  • Login protect dev/dashboard
  • Login protect connect fedi account page
  • Enter fedi url to connect to
  • Ability to update/reset bot fedi config (delete the credentials.json file + clear agent states)
  • Trigger RSS reposter job from ui
  • Add CRON job to read and re-post RSS feeds
  • Track/save posts in memory to prevent dupes
  • Block registration after 1 user signed up (becomes admin this way)
  • Make deploy/publish ready if needed (scripts etc.?)
  • Use Logger.info instead of IO.* for logging important messages
  • Enter fedi url from pleroma or soapbox or other popular fediware (needs more code, wont be just oauth I think...) Just wroks it seems!
  • Grab video from nitter/twitter and add to twoot
  • Manage + put in DB:
    • RSS URLs
    • Dry run mode
    • Scrape interval in ms
    • Max post burst count
    • Fedi account creds
    • Toot formatting template (the 🤖💬 "your text here \n Source:# ")
    • Track/save posts to prevent dupes unneeded imo, causes max 1 or 2 doubles per restart (rare) on current in memory strategy
  • add/remove hashtags to certain posts from certain rss feeds
  • file upload limit backend 2Mb instead show error somewhere when upload img failed
  • error handling rss fetcher or w/e causes it to sometimes crash
  • remove chatgpt impl
  • rss scrape log per url
  • better rss page ui
  • mastodon account info display like username
  • post page improve ui
  • also filter out the ones that are already posted before uploading img etc
  • post stats
    • avg posts per h today
    • post engagements today
  • allow deleting rss source
  • test page for rss source to see if it'll error or not
  • allow multiple bots per fedichan instance
  • find more stats to show
  • Better post fail feedback when posting from bot page (ex. img upload fails sometimes bc too big)
  • Enter fedi auth key from misskey
  • show next up RSS scrape URL in RSS 'start scrape job' section
    • implementing this surfaced a problem, the corn state cannot be accessed, need to use seperate agent to save the state probs
  • Stats engagements is not reliable when thep posts fetched are not the ones interacted with
    • Base on other things like notfications? if possible

Package for deploy

Use the ´./publish.sh´ script to ZIP the project suited for sending to your server.

Migrate DB

Use the ´./migrate.sh´ script to update the DB in case there are pending database model updates for your local instance.

Deploy

check the /deploy folder for scripts.

Ready to run in production? Please check our deployment guides.

Learn more

About

Bot for fediverse written in Elixir, using Phoenix framework

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published