Giter Club home page Giter Club logo

mastodon-api's People

Contributors

alx avatar h3poteto avatar ivansanchez avatar jaller94 avatar vanita5 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  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

mastodon-api's Issues

replace deprecated dependencies

Hi,

we're using mastodon-api at https://github.com/yogthos/mastodon-bot and https://github.com/DomainDrivenArchitecture/dda-masto-embed. At the moment we're trying to get rid of the warning

npm install says:
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

I think mastodon-api is affected by deprecated request also. A solution (found e.g. at https://github.com/HunterLarco/twitter-v2) might be to replace

  • request -> node-fetch
  • and oauth -> oauth-1.0.x

What do you think?

Call to undesired IP

Hello there,

Thank you for this API. I'm using Yogthos' mastodon-bot in a very tigh and controled environment.

The bot has been working very well but has recently begun to make call to an undesired IP address. After some research, this seems to be occuring when using mastodon-api . I'm requesting this profile https://mastodon.xyz/web/accounts/257584 and it results in (among other things) a call to this IP address which is in no way linked or appear on this profile: 163.172.251.107

I unfortunately don't have time to investigate why this is happening so if anyone had an idea I'll be happy to hear it as it quite problematic within my tighly controled environment.

Support for public API

As mentioned in Mastodon’s documentation some API endpoints do not require an authentication. (e.g. statuses/:id)

https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#timelines

If I try to create a Mastodon object without a an access_token I get the following error:

./node_modules/mastodon-api/lib/mastodon.js:345
                    throw new Error('Mastodon config must include \'' + reqKey + '\' when using \'user_auth\'');
                    ^

Error: Mastodon config must include 'access_token' when using 'user_auth'

Is it possible to make unauthorized API calls?

Failed to use streaming/user using js

I'm trying to use GET /api/v1/streaming/user

but Failed to use streaming/user using js

Expected behaviour

that should have Return events that are relevant to the authorized user, i.e. home timeline and notifications to me

Actual behaviour

but gave me this error after 5 seconds of hold
https://github.com/dru18/druBot/blob/master/issue/screenshot/error_streaming_user.png

Steps to reproduce the problem

i'm using this code to get steaming/user
https://github.com/dru18/druBot/blob/master/issue/druStream.js

Specifications

i'm using
OS: Mint 18.3 sylvia

Not deleting heartbeats makes stream parsing fail

The current parsing algorithm means that if a couple of heartbeats are received, and then a update event is received, the value of chunk will be something like

:thump
:thump
event: update
data: {...}

But then, the check for the heartbeat is applied to the whole chunk of data, and for the case described just above, the behaviour is to ignore the whole payload.

Parser emits number for delete events, which get rounded to numbers beyond MAX_SAFE_INTEGER

I was debugging why I was being notified of deleted statuses whose IDs I didn't recognize. For example, I received the following payload from the mastodon-api message listener:

{ event: 'delete', data: 110988663231921360 }

Note that this is a number (even though Mastodon streaming API docs claim it should be a string ID). However, if in parser.js I console.log the raw message, here's what it receives:

event: delete\ndata: 110988663231921363\n\n

110988663231921363 (≈2**56.623) is bigger than MAX_SAFE_INTEGER so it gets rounded to the value coming out of the message listener:

> parseInt('110988663231921363')
110988663231921360

Note how the two numbers above aren't the same.


Do you have any tips on how the parser should be modified to handle this special case? Should we have a list of events that need to be treated as strings (like delete) and pass that through as-is without any JSON decoding?

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.