Giter Site home page Giter Site logo

madon's People

Contributors

keltia avatar mckael avatar penfount avatar rjp avatar roobre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

madon's Issues

Methods don't return Link information

From what I can tell, there is no way of getting the information returned from the Mastodon API's Link: header in methods such as GetTimelines, though this does appear to be used internally in the package's code when multiple requests are needed to get the requested lopt.Limit for these methods; however, this is inconvenient in applications where a developer may want to cache statuses themselves. This presumably affects all of the 19 methods in this package which take a *LimitParams as an argument.

Pleroma compatibility

pleroma doesnt use raw integers as IDs, meaning decoding the account id breaks rn

Post scheduling

A scheduled_at parameter has been added in Mastodon 2.7.0 but it does not seem reflected in the madon's PostStatus.

The README claims 100% API coverage; so it missing by accident?

Can you tag new version?

v2.3.0 doesn't have bot variable and PostStatusParams struct. It makes using go modules hard. Can you make a new tag like 'v2.3.1'?

Return error information from body when status code != 200

Right now, a request returns a non-accepted status code, an error is returned without parsing the body of said request, which usually contains useful information for debugging. It would be great to have it returned as a part of the error message.

I can work on a PR for this if you agree.

How to instantiate a client with access token?

In other libraries there is a method to instantiate a client with an access token and an endpoint url, like this one from masto.js:

import { createRestAPIClient } from "masto";

const masto = createRestAPIClient({
  url: process.env.URL,
  accessToken: process.env.TOKEN,
});

or megalodon-rs (rust):

let client = megalodon::generator(
  megalodon::SNS::Mastodon,
  String::from("https://fedibird.com"),
  Some(String::from("your access token")),
  None,
);

Is there an equal method to instantiate a client?

Attaching media is broken on Akkoma (possibly also Pleroma)

Uploading media is fine but then trying to attach it to a new status fails with a 400. Seems to be the media_ids[] being encoded to media_ids%5B%5D which is throwing things since I can get the same params to work fine if I force media_ids[] via curl. I'll add this to my list.

(I assume this will apply to anything which uses [] in a parameter.)

Use io.Reader instead of file path for media upload

UploadMedia function should receive an io.Reader to avoid the need of creating files when info comes from another source, such as a network resource or an in-memory buffer.

madon/media.go

Line 25 in 9d82599

func (mc *Client) UploadMedia(filePath, description, focus string) (*Attachment, error) {

In order to avoid breaking compatibility, a new method (e.g UploadMediaReader) could be created, and UploadMedia be reworked to open a file and then pass the obtained os.File to the new method.

I can make a PR for this if you think it's ok.

Remote account follow attempt can 404

Hi.

TL;DR: Remote account follow 404s on mastodon.xyz. Could be WAI, could be user error. I have a workaround, just thought you might like to know.

I've been using madonctl, but I'm assuming the underlying issue is in this repo.

My account is on mastodon.xyz. When I run the following command, I get the following error message:

$ ./madonctl account follow '@[email protected]'
Error: API query (v1/follows) failed: bad server status code (404): Not Found

My understanding of the Mastodon API (and Go debugging!) is very limited, but I believe this should call FollowRemoteAccount, and hit the v1/follows endpoint, which... mastodon.xyz doesn't know about? Looking at https://docs.joinmastodon.org/api/, I don't see this as part of the official API, so I'm wondering if this is either unofficial, or not supported by all versions (e.g. whatever mastodon.xyz runs).

As I said, I don't know much about the API, so this is all guesswork. :) OTOH, perhaps it's still useful to make the library more universally applicable (unless I'm just using madonctl incorrectly).

I do have a workaround, so this is no longer an issue for me. I used the search functionality to get an account id:

./madonctl accounts follow $(./madonctl search --resolve $ACCT | grep -o 'Account ID: [^ ]*' | sed 's/Account ID: //')

Very ugly but got the job done.

I realise this report is not very detailed, I'm not sure what's useful to you, but I'm more than happy to help if you need more information.

Thanks,
Simon Frankau.

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.