Bot library for cohost.org

Overview

eggbug

eggbug-rs is a bot library for cohost.org, providing an interface to create, read, edit, and delete posts.

use eggbug::{Post, Session};

// Log in
let session = Session::login("[email protected]", "hunter2").await?;

// Describe a post
let mut post = Post {
    headline: "hello from eggbug-rs!".into(),
    markdown: "wow it's like a website in here".into(),
    ..Default::default()
};

// Create the post on the eggbug page
let id = session.create_post("eggbug", &mut post).await?;

// Oh wait we want to make that a link
post.markdown = "wow it's [like a website in here](https://cohost.org/hthrflwrs/post/25147-empty)".into();
session.edit_post("eggbug", id, &mut post).await?;

// Good job!

License

eggbug-rs is released under the terms of the Anti-Capitalist Software License, version 1.4.

You might also like...
Telegram Bot Template with Cloudflare Workers

cf-workers-telegram-bot-template Usage This template starts you off with a src/lib.rs file, acting as an entrypoint for requests hitting your Worker.

Just a bot for Neovim's Matrix room(s)

nvim-matrix-bot Currently just supports replying to messages with :h some_doc or similar in them with a link to the docs on Neovim's website. Plan i

Music bot written in Rust

Akasuki What is Akasuki? Akasuki is a simple discord music bot written in rust. Highlights Select your music using discord's new select menu feature,

A Discord bot for sending GeoGuessr challenge links that uses the GeoGuessr API written in rust.

GeoGuessr-bot-rs This is a simple implementation of a discord bot that send GeoGuessr-challenge links on demand. Features: Slash-commands Lightning-fa

🦴🤖 // A Discord bot about collecting all the Borpa

🦴 🤖 Borpa Bot Borpa Bot is a Discord bot about collecting all the Borpa possible. If you dont know what a Borpa is you can find it here Crate Descri

A scriptable discord bot (WIP)

Status This project is currently a VERY EARLY WORK IN PROGRESS. Contact me on discord for more details: Jonas747#0001 (105487308693757952) BotLoader (

🦜 A hassle-free, highly performant, host it yourself Discord music bot built with Serenity in Rust. Powered by youtube-dl and Genius.

🦜 A hassle-free, highly performant and fast evolving Discord music bot built with Serenity in Rust. Deployment Usage Just create a bot account, copy

The best discord bot to annoy @a3mat
The best discord bot to annoy @a3mat

A3mat v pomoyke The best discord bot to annoy @a3mat Usage: This command moves pinged users n times: move number [users...] This command moves ping

Telegram bot that zhuzh Twitter content
Telegram bot that zhuzh Twitter content

@twt_2_tg_bot Telegram bot that zhuzh shared Twitter content Text converter Some tweets may contain line breaks or even dialogs. Such tweets are barel

Comments
  • HTTP status client error (422 Unprocessable Entity) for login

    HTTP status client error (422 Unprocessable Entity) for login

    Hi! Thanks for the great library. Maybe I'm doing something wrong but when I run the post example, I get the following error:

    Error: request error: HTTP status client error (422 Unprocessable Entity) for url (https://cohost.org/api/v1/login)
    
    Caused by:
        HTTP status client error (422 Unprocessable Entity) for url (https://cohost.org/api/v1/login)
    

    I've double checked that the provided email/password/page is correct, as well as tried using other pages to authenticate, but I've had no luck. Looking at the login flow via mitmproxy seems to indicate that the login endpoint hasn't changed, so I'm unsure why the 422 error. Still (to me) sounds like the API has had some minor changes, but I can't figure out any as the login code seems to match what I'm seeing using the website under mitmproxy (I'd love to give screenshots/more info, but unfortunately I don't trust my ability to redact sensitive data from an authentication flow trace due to being 3 am, but if you need more info later I can provide it)

    opened by jam1garner 8
  • Update attachment start API

    Update attachment start API

    • API is now more strict about requiring an integer for contentLength. Numeric strings are no longer accepted.
    • width and height are now available (albeit optional) fields. Including these is preferred. I included an implementation for this, although I am amateurish at rust so my way of getting around borrowing path after moving (clones!) is probably incorrect. Would love to know what's actually idiomatic here.

    Tested this works as expected with no changes required for examples/post.rs.

    opened by jkap 5
  • Add ability to fetch posts by project and page

    Add ability to fetch posts by project and page

    Hopefully this API looks okay. My main thought would be that it might not be desirable to re-use the existing post type; if that's true, I'm happy to split that off into a separate read-specific Post type.

    In addition, there's the problem of share trees. I'm tempted to provide an option that doesn't deserialize it in whole. However, because it's not permitted in the API to get a single post by ID, we can't just provide the share tree IDs and leave it at that. As I see it, the options are:

    • always provide the entire share tree, despite it probably often not being used,
    • have a generic parameter on ApiPost that allows selecting whether or not to include the post share tree, using a custom Serde deserialize implementation, or
    • have seperate ApiPost and ApiPostWithShareTree types altogether.

    Personally, I favor the latter.

    opened by NoraCodes 0
Owner
iliana etaoin
pure of heart and dumb of ass
iliana etaoin
Rewrite of the Discord Bot used for Managing the Infinity Bot List Servers.

Arcadia Rewrite of the Discord Bot used for Managing the Infinity Bot List Servers. Contributing Always run fmt.sh before making a Pull Request! MacOS

InfinityBotList 3 Dec 15, 2022
Rust telegram bot library for many runtimes

Telbot Telbot provides telegram bot types and api wrappers. Specifically, telbot now supports: telbot-types: basic telegram types / requests / respons

kiwiyou 17 Dec 3, 2022
Edgelord is a library for Cloudflare Workers. You can scaffold a basic bot for discord, slack, etc.

Edge Computing + chūnibyō = Edgelord ✨ ?? Edgelord Edgelord is now working. You can contribute for it. Edgelord is a Rust library for cloudflare worke

null 23 Dec 26, 2022
A simple bot for discord.

Rusky Um simples bot para o discord! ?? Executando ⚠️ Antes de tudo você precisa do Rust Instalado você pode instalar clicando aqui Preparando Primeir

Rusky 3 Aug 12, 2022
A Simple, But amazing telegram bot, Made using the Rust language!

Telegram bot in Rust A fun Telegram bot made using Rust language.

Deep Alchemy 2 Dec 21, 2021
This is a Telegram bot I'm working on in my free time to learn Rust.

Maldness Bot This is a Telegram bot I'm working on in my free time to learn Rust. Building docker build -t . should be enough.

Sergey Kislyakov 10 May 13, 2022
Play Onitama in your browser, compete with friends or lose to a bot

Play Onitama in your browser, compete with friends or lose to a bot

Jack Adamson 52 Nov 12, 2022
A Discord bot for lichess and Rosen related things

liro Liro is a Discord bot that follows in the footsteps of Lichess-discord-bot, without necessarily aiming to replace it. The main pain point that th

Sebastian Lauwers 5 Feb 16, 2022
This is a simple Telegram bot with interface to Firefly III to process and store simple transactions.

Firefly Telegram Bot Fireflies are free, so beautiful. (Les lucioles sont libres, donc belles.) ― Charles de Leusse, Les Contes de la nuit This is a s

null 13 Dec 14, 2022
Hi I'm Sophy, a discord bot in devlopment, soon I'll be available to help everyone (❁´◡`❁)

Sophy Bot Hi I'm Sophy, a discord bot in devlopment, soon I'll be available to help everyone (❁´◡`❁) Contribution Do you like me and want to help me?

Far Dragi 0 May 30, 2022