Go to file
Móricz Gergő c56fbd5bc8 User.getNotifications, Project.create. WIP 2022-06-29 17:13:28 +02:00
lib Initial commit 2022-06-29 14:24:33 +02:00
.gitignore Initial commit 2022-06-29 14:24:33 +02:00
LICENSE Initial commit 2022-06-29 14:10:14 +02:00
README.md Initial commit 2022-06-29 14:24:33 +02:00
lib.js User.getNotifications, Project.create. WIP 2022-06-29 17:13:28 +02:00
package-lock.json Initial commit 2022-06-29 14:24:33 +02:00
package.json User.getNotifications, Project.create. WIP 2022-06-29 17:13:28 +02:00

README.md

cohost.js

Unofficial API for cohost.org

Install

npm i cohost

Usage

const cohost = require("cohost");

(async function() {
    // Create User and authenticate
    let user = new cohost.User();
    await user.login("YOUR_EMAIL", "YOUR_PASSWORD");

    // Get first Project of user
    let [ project ] = await user.getProjects();

    // Create Post
    await cohost.Post.create(project, {
        postState: 1,
        headline: "hello world from cohost.js",
        adultContent: false,
        blocks: [],
        cws: [],
        tags: [],
    });

    // Get Posts of Project
    let posts = await project.getPosts();
})();

Features

Works:

  • Logging in
  • Getting the posts of a project
  • Creating a post

Doesn't work:

  • Editing a post: possible, haven't done it
  • Sharing a post: possible, haven't done it
  • Liking a post: possible, haven't done it
  • Getting notifications: possible, haven't done it
  • Uploading attachments: possible, haven't done it
  • Getting the home feed: possible, haven't done it
  • Editing profiles: possible, haven't done it
  • Getting followers and following: possible, haven't done it
  • Getting bookmarks and bookmarking: possible, haven't done it
  • Getting a post by its ID: seems impossible? endpoint seems to be disabled
  • Getting posts from a tag: haven''t checked
  • ...everything else