psaegert's picture
Upload 201 files
2c34d2f
###########################################
import json, csv, numpy, datetime, warnings
import pandas as pd
################################################################################
# SETTINGS #
################################################################################
LEMMY_STATS_CRAWLER_FILENAME = 'lemmy-stats-crawler.json'
LEMMY_STATS_CRAWLER_FILEPATH = 'lemmy-stats-crawler/' + LEMMY_STATS_CRAWLER_FILENAME
UPTIME_FILENAME = 'uptime.json'
AGE_FILENAME = 'age.json'
OUT_CSV = 'awesome-lemmy-instances.csv'
################################################################################
# FUNCTIONS #
################################################################################
# do some checks on text that we get back from the instance's API because it
# might break markdown or do something nasty
def sanitize_text( text ):
# markdown table columns are delimited by pipes
text = text.replace( '|', '' )
# newlines
text = text.replace( "\r", '' )
text = text.replace( "\n", '' )
# commas fuck with our CSV file; replace it with this homoglyph (0x201A)
text = text.replace( ",", '‚' )
return text
################################################################################
# MAIN BODY #
################################################################################
# catch runtime warnings from numpy on 'nan' errors when calculating averages
warnings.filterwarnings("error")
##################
# CHECK SETTINGS #
##################
####################
# HANDLE ARGUMENTS #
####################
#####################
# DECLARE VARIABLES #
#####################
readme_contents = '''
# Awesome Lemmy Instances
This repo was created to help users migrate from reddit to lemmy (a federated reddit alternative).
Because lemmy is federated (like email), there are many different websites where you can register your new lemmy account. In general, it doesn't matter too much which server you register with. Just like with email, you can interact with users on other servers (eg hotmail, aol, gmail, etc).
However, each server has their own local policies and configurations (for example, some lemmy instances disable the "downvote" button). The table below will help you compare each site to decide where to register your new lemmy account.
### Terms
* Instance = A lemmy instance is a website that runs the lemmy software
* Community = Each instance has many communities. In reddit, **communities were called subreddits**.
* NSFW = Not Safe For Work
### Legend
* **NU** "Yes" means that **New Users** can register accounts. "No" means that this instance is not accepting new account registrations at this time.
* **NC** "Yes" means that you can create a **New Community**. "No" means that only admins can create new communities on this instance.
* **Fed** "Yes" means that you can interact with other **federated** lemmy instances. "No" means that the instance is partially or fully siloed (you can only subscribe to communities on this one instance or other instances that are explicitly added to an allowlist)
* **Adult** "Yes" means there's no **profanity filters** or blocking of **NSFW** content. "No" means that there are profanity filters or NSFW content is not allowed. Note: "Yes" does not mean all NSFW content is allowed. Each instance may block some types