mckael / madon Goto Github PK
View Code? Open in Web Editor NEWGolang Mastodon API library
License: MIT License
Golang Mastodon API library
License: MIT License
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 doesnt use raw integers as IDs, meaning decoding the account id breaks rn
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?
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'?
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.
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?
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.)
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.
Line 25 in 9d82599
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.