this post was submitted on 15 Jun 2023
37 points (97.4% liked)
FREEMEDIAHECKYEAH
53 readers
1 users here now
๐ฟ ๐บ ๐ต ๐ฎ ๐ ๐ฑ
๐ดโโ ๏ธ Wiki / ๐ฌ Chat
Rules
1. Please be kind and helpful to one another.
2. No racism, sexism, ableism, homophobia, transphobia, spam.
3. Linking to piracy sites is fine, but please keep links directly to pirated content in DMs.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
To accomplish this task, you can use the lemmy-stats-crawler tool available on GitHub.
To extract the list of instances blocking a given instance from a
stats.jsonfile similar to the one you provided, you can use thejsonmodule in Python. Here's a script that takes user input and returns the list of instances blocking the given instance:instance_blocking_checker.pyWhen you run this script and input
lemmy.fmhy.ml, it will output:This script first loads the JSON data into a Python dictionary using
json.loads()[1]. Then, it iterates through theinstance_detailslist and checks if the given instance is in theblockedlist of each instance. If it is, the domain of the blocking instance is added to theblocking_instanceslist. Finally, the script prints the list of instances blocking the given instance.Citations:
[1] https://pynative.com/python/json/
Thanks for this. It's a bit too complicated, hopefully at some point the info will be just available
feddit.de (users active last day = 641)
civilloquy.com (users active last day = 1)
thesimplecorner.org (users active last day = 1)
Thank you :)
instance_analysis.py