this post was submitted on 15 Jun 2023
14 points (100.0% liked)
Lemmy Support
4654 readers
21 users here now
Support / questions about Lemmy.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
To create the
stats.json
file, you can follow these steps:lemmy-stats-crawler
repository from GitHub by running the following command in your terminal:This command will execute the
cargo run
command and redirect the output to a file namedstats.json
. The--json
flag instructs the crawler to output the JSON data.To create a string like
(site:lemmy.world OR site:lemmy.ml OR site:beehaw.org OR site:feddit.de OR site:sh.itjust.works OR site:lemmy.one OR site:lemmy.ca)
from the list of instances extracted from the JSON output of thestats.json
file, you can follow these steps using Python:json
module to work with JSON data[1].Here's a Python script that demonstrates these steps:
This script will output a string in the desired format:
Citations: [1] https://www.geeksforgeeks.org/read-json-file-using-python/
Could something like this be developed into a browser extension? You search in the extension and it does this for you in your preferred search engine?
There are many different search engines and doing an extension that works for all is probably very complex, so I doubt it.