Elon Musk’s Twitter account in telegram and with a translation into Russian

I want to share one of my crafts, perhaps it will also be useful to someone. In this article, I will share what I did to read Musk’s Twitter in a convenient place and have the translation of English-language tweets into Russian at hand.
Over the past few years, I have noticed that I want to start regularly reading this or that blog, but if it is not in the zone of convenient or habitual access (unfortunately, all Twitter is like this for me, I can’t help it, I’m not a Twitter reader), then I quickly forget about it. Even worse, if the blog is in a different language, there is an additional problem when it is difficult to understand the meaning due to technical terms or colloquial jargon. Actually, such “obstacles” usually lead to the fact that it seems to be desirable, but somehow it is not done.
Now I make custom software robots that process online news streams in social networks, filter them, select the most interesting and quoted ones, and transmit them to the customer. I thought, why don’t I use my skills and make life easier for myself in the problem described above. To do this, you only need to go to Twitter every few minutes, pick up new messages, run them through the translator and send them to the channel in Telegram. It seems nothing complicated.
The first problem I encountered was freelancers, from whom I tried to order a piece of code that directly uploads new posts from Twitter, all in a row refused to fulfill the order. They took it directly, and then one computer broke down, another had other things to do, and the third changed his mind at the last moment.
The second problem is Twitter’s refusal to grant access to the API in the cases I described. That is, the only option left is to engage in web scrapping. Well, then.
The third problem, it turned out that it takes quite a lot of manual work to convert a post from Twitter to telegram format, and to make it look decent. In particular, images, link previews, mentions, and so on.
I decided to try it on my own and started googling something like “parsing twitter without API”. There were quite a lot of solutions, I must say that the twin solution is an open source library, which is quite workable and suited my task.
Russian Russian Facebook translation In order to translate the text from English to Russian, I was initially going to use google translate, but I realized that it has a limited number of free translations, so I decided that I would try to use the only neural network I know for translating from English to Russian fairseq from Facebook AI Research. The quality of the translation seemed quite acceptable from the point of view of understanding the essence of the tweet, although it was not perfect.
All this I wrapped in a script in the python programming language and ran on a permanent job on my server.
How to use it
It looks like this now. Each tweet and retweet on the main page of Elon Musk’s Twitter is passed through a translator, links and pictures from the post are selected, and then all this is saved in a post in the telegram channel.

Related Posts

Leave a Reply

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