this post was submitted on 15 Jan 2025
45 points (97.9% liked)

Football (Soccer fútbol fußball 足球 )

5702 readers
2 users here now

Please read the pinned post

Here for discussion of all things association football/soccer!

Rules

Other Football/Soccer Related Communities

founded 2 years ago
MODERATORS
 

With a 10:3 ratio in support for migrating the community off of lemmy.world as suggested by @[email protected] in this post, we will run a trial period of migrating the community over to [email protected]

Trial period

We will run a trial period of 2 months on lemm.ee to see how stable the instance is. Since all of you who discussed potential instances only had good things to say about the instance, expect the trial period to just be formality though.

Locking down [email protected]

The FootballAutoMod has been configured to automatically lock down any new posts and tell the posters to repost in the new community. While I could lock the community completely, I think this solution might help inform those of you who maybe don't check in on the community regularly.

Why lemm.ee

It's a moderately large EU-based instance with little to no drama as far as I know. The admin team seems to be competent and maintains a neutral stance with few defederations across the fediverse. The instance also got multiple recommendations amongst our users.

all 38 comments
sorted by: hot top controversial new old
[–] [email protected] 12 points 1 week ago (4 children)

Hopefully Lemmy is able to tag everyone in the comments so that I don't need to have the AutoMod send a message to everyone (318) who have been active in [email protected] within the last year.

Tagging for notifying everyone of the migration: @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected]

[–] [email protected] 14 points 1 week ago (1 children)

Tagging for notifying everyone of the migration: @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected], @[email protected]

[–] [email protected] 3 points 1 week ago
[–] [email protected] 5 points 1 week ago

thanks, I'm sure I only shitposted one time here about football's cultural atmosphere or game theory/sportsmanship in general.

[–] [email protected] 5 points 1 week ago* (last edited 1 week ago) (1 children)

@[email protected] i discovered a cool bot to manage our communities. We could use it for our backup community and migration.

[–] imaqtpie 3 points 1 week ago (2 children)

Your tag doesn't look like it's working? @[email protected]

But yeah this is actually a fantastic idea, could make migrating communities much more seamless.

[–] [email protected] 2 points 1 week ago

Tag works even without links

[–] [email protected] 2 points 1 week ago (1 children)

Maybe it's because i use mention on Thunder. The tag seems to work on Thunder app.

Do you happen to know the bot used ?

[–] [email protected] 4 points 1 week ago (2 children)

If you are referring FootballAutoMod it's a very basic bot I wrote for posting weekly discussion threads. The tagging of people were just a simple script I wrote to get a list of everyone who have interacted with the community in the last 365 days and then splitting the list up to get within the 10k character limit for comments.

[–] [email protected] 4 points 1 week ago* (last edited 1 week ago) (1 children)

Maybe you should create a post to share your script for users that doesn't know and the lemmyverse. It may be simple but for mod/admin it's a huge change for our life as we post a post, a second one, then close and lost people on the way.

On mastodon, when your change account, migrate on another server, it invite users to follow you on your new address and update it for you. And, i think i will suggest it for Piefed, a integrated functionality will be very helpfull. :)

With this script, can you get the list of subcribers ?

[–] [email protected] 5 points 1 week ago* (last edited 1 week ago) (1 children)

With this script, can you get the list of subcribers ?

I don't think the Lemmy API exposes the subscriber list of a community, you'll need access to the instance database.

What I did was checking every post for the last 365 days for user activity and store every user that have interacted with the community.

lemmy_session and lemmy_references are the same as for the LiveThreadBot (inside the src folder): https://gitlab.com/UlrikHD/lemmy-match-thread-bot

get_posts() may be missing from the lemmy_session.py file though

    def get_posts(self, *, community: int | str | LemmyCommunity, sort: str = 'New', page: int = 1) -> dict[str, any]:
        """ Gets the posts of a community.

        :param community: The ID of the community to get the posts of, can also be a LemmyCommunity parseable
        string/object.
        :param sort: The sorting method of the posts, by default 'New'.
        :param page: The page number of the posts, by default 1.
        :return: The response JSON of the request as a dictionary.
        """
        if isinstance(community, LemmyCommunity) or isinstance(community, str):
            response: Final[requests.Response] = self.srv.get_posts(community_name=community, sort=sort, page=page,
                                                                    limit=50)
        else:
            response: Final[requests.Response] = self.srv.get_posts(community_id=community, sort=sort, page=page,
                                                                    limit=50)
        if response.status_code != 200:
            raise requests.exceptions.HTTPError(response.text)
        return response.json()

Excuse the ugly code, it was written as a one-off

import os
import time
import datetime
from json import load, dump
import requests
from lemmy_references import LemmyCommunity, LemmyUser
from lemmy_session import LemmySession


session: LemmySession = LemmySession(website='https://lemmy.world/',
                                     username='TestUlrikHD',
                                     password='---',
                                     end_script_signal=None)

posts: list[dict[[str, any]]] = []
cutoff_date: datetime.datetime = datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(days=365)
page_count: int = 1
loop_break: bool = False
while True:
    post_response: dict[str, any] = session.get_posts(community=LemmyCommunity('football', 'lemmy.world'),
                                                      page=page_count)
    page_count += 1
    for post in post_response['posts']:
        if datetime.datetime.fromisoformat(post['post']['published']) > cutoff_date:
            posts.append(post)
        else:
            loop_break = True
            break
    if loop_break:
        break

user_dict: dict[str, dict[str, any]] = {}
for post in posts:
    user_dict[str(LemmyUser(post['creator']['actor_id']))] = {'post': True, 'post_id': post['post']['id']}
    comments = session.get_post_comments(post_id=post['post']['id'])
    for comment in comments['comments']:
        user: str = str(LemmyUser(comment['creator']['actor_id']))
        if user not in user_dict:
            user_dict[user] = {'post': False, 'post_id': comment['post']['id'], 'parent_id': comment['comment']['id']}
del user_dict[str(LemmyUser('[email protected]'))]
del user_dict[str(LemmyUser('[email protected]'))]
with open('user_dict', 'w', encoding='utf-8') as file:
    dump(user_dict, file, ensure_ascii=False, indent=4)


def log_reply(usr: str) -> None:
    user_list: list[str] = []
    if os.path.isfile('reply_list.json'):
        with open('reply_list.json', 'r', encoding='utf-8') as file:
            user_list = load(file)
    user_list.append(str(usr))
    with open('reply_list.json', 'w', encoding='utf-8') as file:
        dump(user_list, file, ensure_ascii=False, indent=4)


for username, user in user_dict.items():
    time.sleep(1)
    try:
        #if user['post']:
        #    session.reply(content='migration message', post_id=user['post_id'], parent_id=None)
        #else:
        #    session.reply(content='migration message', post_id=user['post_id'], parent_id=user['parent_id'])
        log_reply(usr=LemmyUser(username).str_link())
    except requests.HTTPError as e:
        print(f'Failed to send message to {username} - {e}')

and this part creates txt for easy copy pasting for tagging.

from json import load

with open('reply_list.json', 'r', encoding='utf-8') as file:
    user_list: list[str] = load(file)

loop_count: int = len(', '.join(user_list)) // 9500 + 1
for i in range(loop_count):
    with open(f'reply_list_{i}.txt', 'w', encoding='utf-8') as file:
        print(len(' '.join(user_list[i * len(user_list) // loop_count:(i + 1) * len(user_list) // loop_count])))
        file.write(', '.join(user_list[i * len(user_list) // loop_count:(i + 1) * len(user_list) // loop_count]))
[–] [email protected] 5 points 1 week ago (1 children)

Thank a lot, i will share on our Meta community so we can save it and setup an migration bot. :)

I also shared this idea so maybe Piefed can integrate it into its core with a migration button where you add the new address and subcribers will receive a notification to join the new one.

[–] [email protected] 4 points 1 week ago

If you need any technical help, you can message me at @[email protected]

[–] [email protected] 3 points 1 week ago

Still great!

[–] [email protected] 4 points 1 week ago (1 children)

Amazing, that's very useful!

[–] [email protected] 2 points 1 week ago (4 children)

Has the [email protected] community been opened to general users¿? I wasn't able to join that community

[–] [email protected] 1 points 1 week ago (1 children)

It was opened right before this post, could be some federation delay maybe?

[–] [email protected] 1 points 1 week ago

I can access it from my alt

[–] [email protected] 1 points 1 week ago (1 children)

In case you had the same issue I did, it worked for me using [email protected] (uppercase first letter) but I couldn’t subscribe if it’s all lowercase

[–] [email protected] 1 points 1 week ago (1 children)

What the hell! This worked. Is this a client specific issue¿? Is this an lemmy issue¿? Are lemmy community names case sensitive¿? If yes, then why the lowercase name point to the same fucking community¿? What the hell is going on

[–] [email protected] 1 points 1 week ago (1 children)

What client are you using?

[–] [email protected] 1 points 1 week ago (2 children)
[–] [email protected] 1 points 1 week ago

I'm on Voyager too, might be client specific then.

[–] [email protected] 1 points 1 week ago (1 children)
[–] [email protected] 2 points 1 week ago

Yeah now that the other member also confirmed that they are on Voyager, I will raise a bug request

[–] [email protected] 1 points 1 week ago (1 children)
[–] [email protected] 1 points 1 week ago

Odd. I am not able to do it. Will look into it later

[–] [email protected] 9 points 1 week ago (1 children)

Thank you for the heads up folks

[–] [email protected] 3 points 1 week ago

See you there!

[–] imaqtpie 5 points 1 week ago (1 children)

I was just about to say this is the first I'm hearing of this and I have serious reservations about this idea, because moving communities is always tough.

But then I saw the automod tag everybody, and that's a really nice solution you've come up with. I would say maybe send out a few more pings over the next couple months and also post about it on [email protected], just to make sure that everyone gets the message.

Assuming that most users hear about this and subscribe, I think lemm.ee is a great choice for a new home.

[–] [email protected] 5 points 1 week ago (3 children)

Assuming the FotballAutoMod works fine with the code I've pushed, anyone who posts to this community now will have their post locked + a reply from the AutoMod that the community has migrated. Hopefully it will work well.

[–] [email protected] 3 points 1 week ago (1 children)

Just tried, nothing happened 😅

[–] [email protected] 4 points 1 week ago (1 children)

Yeah, found the bug.

If you're curious about the details. When the script gets the list of most recent posts from lemmy, pinned posts are at the start of the list. Since I had the script break the loop once it discovered a post older than last time it checked for new posts, it would always break the loop on the first post since the migration post is pinned. Should be fixed now.

[–] [email protected] 2 points 1 week ago

Great, thanks!

[–] [email protected] 2 points 1 week ago

Very interesting

[–] [email protected] 2 points 1 week ago

I want to try ha ha

[–] [email protected] 4 points 1 week ago

As a lemm.ee user myself, I approve of this.