Skip to content

Commit

Permalink
Some rough sketch out of how to add follows/blocks to a Lemmy setting…
Browse files Browse the repository at this point in the history
…s file

See #21
  • Loading branch information
chris-y committed Jul 3, 2024
1 parent 059d89c commit 581e3f7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
_*.json
directory.json

*.json
35 changes: 35 additions & 0 deletions scripts/lemmy_settings_modify.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/python3
import json

lfile='./lemmy_export.json'

blks='./blocks.json'
flws='./follows.json'

wipe_flws = False
wipe_blks = False

with open(lfile) as l:
settings = json.load(l)

print(settings['followed_communities'])
print(settings['blocked_communities'])

if wipe_flws is True:
settings['followed_communities'] = []

if wipe_blks is True:
settings['blocked_communities'] = []

with open(flws) as f:
follows = json.load(f)

with open(blks) as b:
blocks = json.load(b)

settings['followed_communities'].extend(follows)
settings['blocked_communities'].extend(blocks)

print('----------------')
print(settings['followed_communities'])
print(settings['blocked_communities'])

0 comments on commit 581e3f7

Please sign in to comment.