Git Product home page Git Product logo

Comments (12)

hughrun avatar hughrun commented on September 22, 2024 1

there is also now a new beta version which may or may not help.

from ephemetoot.

hughrun avatar hughrun commented on September 22, 2024 1

Nice work!

PRs are definitely welcome (see contributing in the docs folder or link from README). I'd prefer not to create a directory if it's not there, because that might be unexpected behaviour for users, but a better error message is definitely a good idea.I moved a bunch of code around in the last couple of weeks while I was adding tests, so actually the error messages were all messed up anyway.

Re the permissions error:

TBH I'm more careless than you and just always gave ephemetoot all read/write permissions. Obviously this is something that should be more explicit in the docs though, and I should have really tested already.

I'll do some thorough checking today to check the minimum requirements but looking at it, you probably need:

Read

  • accounts (I think)
  • favourites
  • statuses

Write

  • statuses

You might need write permissions for favourites when deleting them if the API wants to unfavourite before deleting.

from ephemetoot.

hughrun avatar hughrun commented on September 22, 2024

Apologies @trev-dev I prematurely updated the docs: up until last week ephemetoot was not in pypi and install was via git.

The first version uploaded to pipy (v2.6.1) is borked because I didn't know what I was doing.

Right now you can resolve the error by uninstalling and then installing the alpha version 3 but you have to pin the exact version because it's a pre-release:

pip uninstall ephemetoot
pip install ephemetoot==3.0.0-alpha.0

I expect to have a 'proper' v3.0.0 in pypi by the end of this weekend. The current docs should work for 3.0.0a0.

from ephemetoot.

trev-dev avatar trev-dev commented on September 22, 2024

Thank you!

from ephemetoot.

trev-dev avatar trev-dev commented on September 22, 2024

LOL, the alpha version is throwing a 50x error when trying to connect to my instance. I'll wait for the release.

from ephemetoot.

hughrun avatar hughrun commented on September 22, 2024

@trev-dev that's...unexpected. Do you mind posting your config (but not your real access token, obvs)? This is either your config file being not quite right, your server being weird, or a new and exciting bug.

from ephemetoot.

trev-dev avatar trev-dev commented on September 22, 2024

It tried the beta and it's the same result. Here's my config :D Running ephemetoot --test

-
  access_token: redacted
  username: trevdev
  base_url: mastodon.technology
  days_to_keep: 182
  keep_pinned: true
  hashtags_to_keep:
    - #python
    - #javascript
    - #vuejs
    - #react
    - #teaching
    - #scratch
    - #pygame
    - #privacy
    - #security
    - #linux
    - #foss
    - #arch
    - #debian
    - #opensource
    - #reactjs
    - #webdev
    - #pelican
    - #100daysofcode
    - #diaspora
    - #mastodon
    - #django
    - #emacs
    - #vim
    - #neovim
  archive: ~/Downloads
(ephemetoot) āžœ  ephemetoot ephemetoot --test

============= EPHEMETOOT v3.0.0b0 ================
Running at Sun 06 Sep 2020 22:46:17 +0000
================================================

This is a test run...

Fetching account details for @[email protected]

šŸ˜•  Server has returned an error (5xx)

from ephemetoot.

hughrun avatar hughrun commented on September 22, 2024

Ah, I can possibly see a problem but the error message is extremely unhelpful for you to spot it!

Hashtags should not include the hash (this is to do with how the Mastodon API works). So your tag list should look like:

  hashtags_to_keep:
    - python
    - javascript
    - vuejs
    - react
    - teaching
    - scratch
    - pygame
    - privacy
    - security
    - linux
    - foss
    - arch
    - debian
    - opensource
    - reactjs
    - webdev
    - pelican
    - 100daysofcode
    - diaspora
    - mastodon
    - django
    - emacs
    - vim
    - neovim

Do you mind checking if that fixes it? I'm not entirely convinced it will, but it's a problem anyway.

I'm looking into better error checking for --init to catch things like this.

Also I'm going to create a --verbose flag ( #51 ) to help troubleshoot stuff like this because there's probably something useful in the actual Exception message, which we can't currently see.

from ephemetoot.

trev-dev avatar trev-dev commented on September 22, 2024

Verbose is a great idea!

I'm still getting the 50X error after removing the pound symbols. I have a fork handy maybe I can help.

from ephemetoot.

trev-dev avatar trev-dev commented on September 22, 2024

I stuck a stack trace using pdb to see what the error actually is when we hit line

print("\nšŸ˜• Server has returned an error (5xx)\n")

The error is a 403 error. I only gave ephemetoot read/write access to posts, what sort of permission does ephemetoot need at a bare minimum?

============= EPHEMETOOT v3.0.0b0 ================
Running at Mon 07 Sep 2020 03:01:19 +0000
================================================

This is a test run...

Fetching account details for @[email protected]
> /home/trev/.local/share/virtualenvs/ephemetoot-7ki6mRLC/lib/python3.8/site-packages/ephemetoot/ephemetoot.py(481)check_toots()
-> print("\nšŸ˜•  Server has returned an error (5xx)\n")
(Pdb) e
MastodonAPIError('Mastodon API returned error', 403, 'Forbidden', 'This action is outside the authorized scopes')
(Pdb) 

from ephemetoot.

trev-dev avatar trev-dev commented on September 22, 2024

So giving ephemetoot access to everything fixes this problem. Also, if you have an archive directory that ephemetoot cannot find, it doesn't attempt to create it, it just fails ungracefully by yelling ERROR: 2. No real technical problems here, just a need for better documentation and more graceful error messaging šŸ‘ Are PRs welcome?

from ephemetoot.

hughrun avatar hughrun commented on September 22, 2024

FYI it looks like the required permissions are:

  • read:accounts
  • read:statuses
  • write:conversations
  • write:statuses

I'm adding that to the docs.

from ephemetoot.

Related Issues (20)

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.