aka freamon

Codeberg: https://codeberg.org/freamon?tab=activity

Anything from https://lemmon.website/ is me too.

  • 4 Posts
  • 186 Comments
Joined 1 year ago
cake
Cake day: March 27th, 2024

help-circle


  • The only way I can think of is to use the API to get all communities, and then filter out the ones without local subs. So a basic BASH script would be:

    #!/bin/bash  
    
    echo -n '' > /tmp/allcomms.txt  
    
    page=1  
    while true  
    do  
      communities=$(curl --request GET --url "https://walledgarden.xyz/api/v3/community/list?type_=All&page=${page}&limit=50" --header 'accept: application/json' | jq .communities[])  
      if [ "${communities}" == "" ]  
      then  
        break  
      fi  
      jq -r '[.community.id, .counts.subscribers_local] | @sh' <<<$communities >> /tmp/allcomms.txt  
      page=$(( page + 1 ))  
      sleep .5  
    done  
    
    while read id count  
    do  
      if [ $count -eq 0 ]  
      then  
        echo "$id has no local subs"  
      fi  
    done < /tmp/allcomms.txt  
    

    (It’ll take a few minutes to run)

    After that, how you purge the communities with those IDs I’m less sure of. My guess would be:

    Get a login tokin:
    JWT=$(curl --request POST --url https://walledgarden.xyz/api/v3/user/login --header 'accept: application/json' --header 'content-type: application/json' --data '{"username_or_email": "YOUR_USERNAME","password": "YOUR_PASSWORD"}' | jq -r .jwt)

    Use Admin/Purge from the API:

    curl --request POST --url https://walledgarden.xyz/api/v3/admin/purge/community --header "authorization: Bearer $JWT" --header 'content-type: application/json' --data "{"community_id": ${id}, "reason": "no local subs"}"  
    

    As long as purge lets the community be recreated again (which it should do), then that should be okay.

    Don’t take my word for any of this for an in-production Lemmy server, though. Test first!











  • Nothing. It wasn’t about the edit.

    I’ve said elsewhere that I thought your second follow-up question was disingenuous, so I’ll expand on that here. That’s the thing that annoyed me. Not because I think no-one should question me, or because no-one should inquire further, but because the more questions you want to ask about a particular thing, the more informed those questions need to be. Otherwise it just gets tedious, explaining why irrelevant things are irrelevant. User display names aren’t relevant to an API’s ‘/site’ response; ActivityPub isn’t relevant at all, and ‘name’ is such a generic, widely-used word, that reaching for it as evidence that I might be confused is such a stretch, I don’t know why you’d go for it. It made me question your motive, given that the likelihood of you being correct - after fishing a word out from something you don’t seem that experienced with - is so low. It stops reading as a well-intentioned question, and starts reading as scepticism for scepticism’s sake.




  • it’s silly to ask you for advice because you don’t use Lemmy

    That was never my argument. I think you know this.

    Being reluctant to answer any more questions about a topic doesn’t mean I was wrong to provide an initial answer. It just means my bandwidth has been exceeded. If Lemmy was a project I was invested in, and I didn’t think your second follow-up question was disingenuous, then it would’ve been different, but as things were, I resented being given homework about it.



  • You and db0 are doing different things - he has blog that Lemmy users can interact with as if it was another Lemmy community, whereas you have a blog that you want to use to post articles into a different Lemmy community.

    A reply is sent from Lemmy twice - once to the community to Announce out to its followers, and once to the person being replied to. A top-level reply will appear on the WordPress blog because it is a reply to the author. A reply to a reply won’t, because the blog is not following the Lemmy community (so won’t get the Announce), and the author isn’t the person being replied to.

    If you want a reply to a reply to also appear on WordPress, you need to treat it like Mastodon, and also Mention the original author. Here is an example that also appeared on the blog: https://lemmy.world/comment/14897939 (the reply from ‘freamon’)



  • I used ‘unscientific’ because it would be a pain in the arse for someone else to reproduce, it only applies to one instance, it’s a test on someone else’s in-production system that you have no control over, and the error that returns isn’t necessarily from the backend. It looks more like a Form Validation error (i.e. from the frontend). It’s perfectly possible to create a frontend that puts it’s own limits on username length, and there’s some that no doubt already exist, so a brute-force test of those limits isn’t telling you anything reliable about what Lemmy’s internal limits are.