How I wrote a freelance order (Python). Part 1

Good evening colleagues and Khabarovsk residents.
I am a programmer with 3 years of experience, I have been working as a freelancer for a long time. Until recently, I worked exclusively through connections, so there were always very few reviews on freelance exchanges, and I didn’t really want to work with random people.

Recently I had a need for “quick” money, and the lack of orders from friends forced me to jump headlong into the competitive pit of mud called “Kwork“No, don’t think so, I have nothing against the platform itself. It is convenient, it’s safe to execute and buy orders, and the loyal and equal attitude towards both sides of the transaction is definitely a plus among many freelance exchanges.

I know what you are thinking about now, my beloved ones. Yes, definitely, on American freelance exchanges they will pay more than on the same kwork for the same work done, but I already said that I needed “quick” money, so I wasn’t really eager to deal with all this.

After completing one of the cheap orders, my now regular customer decided to give me a new specification: write parser For hh.ru to send new vacancies to the TG channel.
It sounds simple, but there are always some pitfalls.

It's worth clarifying. This is my first article using code. This can be compared to the first content on OnlyFans, I hope you understand what I mean 🙂

Algorithm

Any of my code (and I hope yours too) begins with thinking about the algorithm. The customer wants to be able to insert a link to one or more categories, and the bot itself will already monitor them and display new advertisements in the TG channel, which he will then promote (it doesn’t matter, that’s his job).

Let's imagine the bot's actions:

  • The counter is reset to zero.

  • The loop goes through an array with links

  • The bot follows the link, compares the latest ads

  • Missing advertisements are included in the array with the latest advertisements and published in the TG channel

  • The meter starts again

Everything seems simple. Now let's discuss the user side algorithm.

  • The customer writes /start

  • The customer selects “Add catalog” from the menu

  • The customer adds a new catalog and forgets about the existence of the bot

  • For a long time, the TG channel will be spammed with new vacancies 😀

I would break this up into several scripts, but lately I’ve been so lazy to do this that I fit everything into one script. I hope no one will criticize my code.

Everything else will be in the second part of this article, because everything is written as we go.
Thank you for your attention

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *