r/learnpython • • Mar 22 '23

What do you even code?

I am a beginner to python and all coding. I don't know much. All the recommendations are "code everyday". Practice every day is great but what do I practice? Do I open up an empty IDE and code what? I don't know how to do any projects on my own. Do I just YouTube crap and copy them or what? What do I actually code?

341 Upvotes

107 comments sorted by

View all comments

1

u/deadeye1982 Mar 22 '23

Today I found an interesting news article (German) about an organization, which changes DNS-Entries, if there is a copyright infringement.

The page was blocked accidentally.

One commentator gave the hint about this URL: https://cuii.info/empfehlungen/

So, I thought why not write a short script, which parses the page and spits out the DNS-"blocked" WAREZ sites:

# requires requests and bs4 (beautiful soup)
import requests, bs4


def get_illegal_urls():
    doc = bs4.BeautifulSoup(
        requests.get("https://cuii.info/empfehlungen/").content, "lxml"
    )
    return [
        "http://" + element.text.split()[0].lower()
        for element in doc.select("span[itemprop=text]")
    ]


print("==== Good warez sites ====")
for url in get_illegal_urls():
    print(url)

To be able to access the links, you require an unfiltered DNS-Resolver or use Unbound.