I don’t know how reliable or practical it is. After learning python programming I needed to work on any project to actually improve my skills and understand how python works. So i built a Anti-AI blocklist using various sources and my own manual denylist.

I also implemented a dead domain link filtering by trying to initialize a query to each entries. If it fails more than 10 times, it will be added to dead domains, only applicable for external sources. Yes, I know most of you guys will ask what if some domains get blocked by security firewalls. I don’t know. In my research I found that there is no ways to identify it is blocked by a firewall or actually a dead domain by the response received. But I will try to improve it as i can.

The update process is done using github actions. First I setup built-in scheduling only to realize even after 12 hours days it didn’t run atleast once. So after getting fraustrated I used a domain called cron-job.org to setup triggers. Now it working flawlessly.

  • one_old_coder@piefed.social
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 days ago

    I don’t understand who should use this project, or what it is doing, but you must wrap the global code (everything in list_sources.py except the function is_dead_domain) inside a “main function” like:

    def main(): pass  
    if __name__ == "__main__": main()  
    
  • jtrek@startrek.website
    link
    fedilink
    arrow-up
    3
    ·
    1 day ago

    Unsolicited feedback time!

    You probably should write smaller functions that do one thing, instead of one long script.

    It’s helpful to use type annotations. So you can write like

    def something(thing: int, name: str) -> int:
    

    And then static analysis tools (eg: mypy, ty, pylance) can tell you when you messed up

    Why not use requests library for network stuff?

    You might want to include a pyproject.toml for requirements. uv is also popular for dependency management.

    Maybe look into unit testing if this is going to live for a while