Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe we should attach a file with a list of communities for each section so users can block/sub to the whole sections at once. #21

Open
M4rtineski opened this issue Jun 20, 2024 · 12 comments
Assignees
Labels
Discussion/Question New feature or request Planned

Comments

@M4rtineski
Copy link
Contributor

This would require figuring out where to host those files, what tools are available for the job etc. At the very beginning of the directory we could share files with political communities so people could easily block those too.

@M4rtineski M4rtineski added the Discussion/Question New feature or request label Jun 20, 2024
@chris-y
Copy link
Contributor

chris-y commented Jun 21, 2024

We could easily host them in this repo (or a new one if that's preferred).
This would also make it easier to feed bestofbot fnic-lemmy/bestofbot#14

Lemmy doesn't have a upload block list option though - is there a tool available which will do that?

@M4rtineski
Copy link
Contributor Author

Tool for subbing: https://sh.itjust.works/comment/12044014

Hopefully blocks are implemented at this point: https://lemmy.world/comment/1764730

Btw, blocks and subs are in profile settings that you export/import so you can always do something yourself to import the list into the exported file to import it back.

@chris-y
Copy link
Contributor

chris-y commented Jun 24, 2024

I created a script https://github.com/fnic-lemmy/lemmy-directory/blob/main/scripts/directory_to_json.py which extracts the entire directory to a JSON file. We can easily modify that to create import files if we know the right format.

@M4rtineski
Copy link
Contributor Author

Cool. Will look into how to do that once I finish organising the current set of communities.

@M4rtineski
Copy link
Contributor Author

Changed priority of this because I need this soon.

@M4rtineski
Copy link
Contributor Author

@M4rtineski
Copy link
Contributor Author

@chris-y
Copy link
Contributor

chris-y commented Jul 3, 2024

Import and export have an API:
https://lemmy.readme.io/reference/get_user-export-settings
https://lemmy.readme.io/reference/post_user-import-settings

I don't think it's in Pythorhead yet.

@chris-y
Copy link
Contributor

chris-y commented Jul 3, 2024

Although if you're doing that you may as well just loop through and follow/block the individual communities.

I did have a little tool which did this but it didn't work very well so maybe it's not a very reliable option.

@chris-y
Copy link
Contributor

chris-y commented Jul 3, 2024

As discussed on Matrix, a tool which just modifies the manual export/import file might be preferable at this stage.

@chris-y
Copy link
Contributor

chris-y commented Jul 3, 2024

https://github.com/fnic-lemmy/lemmy-directory/raw/main/scripts/lemmy_settings_modify.py

Very rough draft. The community import/export files need to be lists of communities in URL format (not the format we feed into bestofbot). The wipe_* vars you can set to wipe out your current settings and replace them with the contents of the file. It needs lots of polish, including supporting the same format bob uses.

@chris-y
Copy link
Contributor

chris-y commented Jul 12, 2024

Had a few minutes to update this.
You can now call it on the command line with -i <your-export-file> -o <new-file-to-create-for-import> -s <file-containing-list-to-subscribe> -b <file-containing-list-to-block> -S -B

-S and -B if specified will wipe out the current subs and blocks lists respectively, otherwise the new lists will be appended.

The lists which directory_to_json.py creates are in the format this expects.

Your output file should be able to be imported into Lemmy successfully (I haven't actually tested this bit)
https://github.com/fnic-lemmy/lemmy-directory/blob/main/scripts/lemmy_settings_modify.py

Ideally we need to rewrite this in a portable compiled language to make it easy for people to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion/Question New feature or request Planned
Projects
None yet
Development

No branches or pull requests

2 participants