Gnubesoft: Automate the Criminal Stuff - Part 3
Video Description:
Continuing directly from Part 2, in this video I make web scrapping look easy! I also answer the first viewer question from fellow YouTuber TheAudioDabbler:

If you missed Part 2:
If you missed Part 1:

If you'd like to support this series, please join me on Patreon!
Or Timmeon:

Hi Tim, I was wondering when you programmed your website if you went full on OOP or not.

Be The Noise said on August 18, 2019

Hi Tim, I was wondering when you programmed your website if you went full on OOP or not.

There are elements to all Python programming that can be considered OOP. I'm using the whole swath here! I guess the most OPP parts are Class Models, but really it is all OOP all the way down.

Now that I come to think of it, the only code that isn't OOP would be the JavaScript. I didn't need classes or inheritence there.

I know that everything in Python is an object. I guess it was a silly question. I was wondering if you created classes of your own. I suppose with a project of such scope you must have.

Oh, yeah. That's just something you do as needed.

The structure of websites tends to be very different from other programs. The code is basically just sitting there waiting for you to hit it, and then it needs to figure out what page to return.

This Event Driven approach is unique, but it gets even weirder because it is also Stateless. The code doesn't actually remember who you are or who I am. It just reacts to events. In fact if you try to give it a state, like saving a user-specific variable, it will probably break. The backend for this site is being run by four different "Workers". Each time you visit the site you get one of these random workers that runs the code. That worker probably wouldn't have any user-specific variable that was saved on only one of the four workers.

So designing the backend to a site is all about using events and a limited amount of information to try to figure out WTF is going on. Deciding what you should, or should not, be showing the site's visitor for the specifically requested URL. This necessitates a code structure that is entirely unlike any other common code pattern.

But yes, that does include making classes when you need bespoke or complex objects.

New Comment

You are not logged in. You may comment anonymously, but will not be able to edit your comment.

Registration is fast! Already have an account? Login now!

This username is invalid or already used.
This email is invalid.
This URL is invalid.