Twitter Feeds Discussion – Telegram
Twitter Feeds Discussion
24 subscribers
22 photos
3 videos
14 links
Discussions and updates about twitter->telegram broadcasting bot
Download Telegram
Couple of cosmetic updates today.

1. When posting the quoted tweet, bot removes the link to the original tweet from the text. The format for the quote and retweet is more compact.

2. When the tweet contains a link, the link is replaced from t.co format to the original link.
And finally, the small thing which annoyed me for quite a while: tweets with media attached have links to this media page in Twitter. Basically, the tweet itself.

Removing this link requires 1 line change in the 3rd party library I use. The change is proposed to the library maintainer, but meanwhile, I have done it locally and deployed a new version of the bot.
Some of you might have noticed this message being posted (and deleted) several times. No, this isn't another M113A3 incident.

The reason is that the tweet is both the reply and the quote. It was only posted as a quote, and I was trying to find out why.

On top of that, the link to the quoted tweet (twitter.com/poetaetrr/stat…) was not removed because it contained some query parameters (?t=...&s=...)

The fix is already there. Moreover, it also removes trailing empy lines after removing the link to quoted tweets. You can see how this looks like from now on on the screenshot.
The bot generally sends photos and videos by passing URLs to Telegram. Telegram then itself retrieves photos and videos. But sometimes Telegram fails, and I don't know why. Examples are here and here.

Now, in this case the bot tries to actually download failed files and upload them to the Telegram. In the sandbox, it worked with the tweets above. Let's see whether it will work in the real life.

Just to make these cases visible, bot posts these media with "(@)" prefix, not the usual "(#)". Here is an example.

There are still scenarios when this will fail. Twitter allows uploading videos up to 250Mb, and Telegram only up to 50Mb. But I will be solving this issue only when it starts appearing on the regular basis.
There was a duplicate (already removed) of this post. I've started investigating this while having M113A3 incident flashbacks.

Twitter API had connection time outs for about an hour, thus resulting in Lambda timeout. The Lambda timeout ment that bot didn't save the posted tweet, so it posted it again.

Looks like an occasional hiccup. I still need to think, whether it make sense to save the last posted tweet as soon as it's posted.
I realized that there were no post in @UAWeapons since 1 Feb 2023 to 8 Feb 2023.

Short investigation revealed that the bot failed posting this tweet.

Quick fix: marking this tweet as posted, so it's skipped.

Long term fix needs proper investigation.
About a week ago, Twitter announced that they will stop the free access to their API on 9 Feb 2023.

There is still no further information (how much? for what?), so I'm waiting for details.

If the cost is prohibitive, I will be checking other options to access the data. But this will take some time.
If video was sent by uploading (this happens for bigger video files, and you can see it by "(@)" prefix instead of "(#)"), Telegram ignored its dimensions and display it as a square: https://news.1rj.ru/str/UAWarReports/9802

In order to see it with right dimensions, you had to download it and use external player.

Now, I have added passing width and height information, so these videos shall be displayed properly.
This media is not supported in your browser
VIEW IN TELEGRAM
📢 The free access to Twitter API will end on 1 May. 📢

This channel uses Twitter API to retrieve tweets for posting, and I can't afford paying $100 every month for a pet project. But I don't want to drop it either.

So, with the help of @nakedbotch, the author of @getnaked_bot and @IGSpyBot (highly recommend to check out both of them) I am trying to look for a workaround.

There is a good chance that every now and then, some things will be broken. There is also a chance, that at some point, the project will stop working completely. Let's see - I'll try to keep it alive as long as I can - with a meaningful effort.

Please fasten your seatbelts and expect some turbulence coming!
Well, just in a 2-3 days, the main share of the work is done.

Featurewise, it should be matching the current set. There is a couple of missing things under the hood like getting numerical user ID via twitter name, but you should not see it.

I am sure some issues will surface as well as Twitter will be changing some items. I will keep an eye on them.
Now, the bot properly handles long tweets. Instead of posting a trunkated version of the tweet, it posts the whole text.