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
This one is also wrong:
To extract the list of instances blocking a given instance from the provided JSON structure, you can use the
json
module in Python. Here's a script that does that:This script first loads the JSON data and parses it into a Python dictionary. Then, it defines a function
get_blocked_instances
that takes a domain as input and returns the list of blocked instances for that domain. Finally, it takes the user input for the instance to check and prints the list of blocked instances for that domain.Citations:
[1] https://stackoverflow.com/questions/14048948/how-to-find-a-particular-json-value-by-key
[2] https://ankushkunwar7777.medium.com/get-data-from-large-nested-json-file-cf1146aa8c9e
[3] https://www.geeksforgeeks.org/read-json-file-using-python/
[4] https://pynative.com/python-check-if-key-exists-in-json-and-iterate-the-json-array/
[5] https://hackersandslackers.com/extract-data-from-complex-json-python/