As the title already announces it, and the post image shows, a code snippet of a web scraper I programmed for one of my sites, of course the code to decompose HTML, for this I use the Simple DOM HTML PHP code, but every website is different and although many have great similarities, there are exotic content management systems, where I wonder why so complicated, even if simple, well, probably just to make it difficult for me then 😛
The code I programmed should extract a link to a picture, only this picture link has parameters with further information to further picture sizes, but not as simple Key=Values, but with rectangular brackets and there it becomes already a little bit jerky to manipulate the code in such a way, in order to be able to read out finally this then.
The code itself is easily 5 years old, and in the 5 years I have also been able to expand my knowledge, you never stop learning.
So it's more a relic from my work a few years ago and ultimately shows how important it is to document, especially when the code or function is not easily understandable. The snippet came to me when I was looking for, well, snippets to reduce the programming effort. And there you smile yourself sometimes, when you read: Okay, this shit is hard....