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
Meanwhile, some retrospective on the development, just to give an idea what are the iterative improvements visible to you.

Initially, the bot was posting just a link to the tweet plus the text. It was up to Telegram to take the link and generate the preview. It worked fairly well for text tweets (though generating unneccessary previews) and single photo tweets.

Videos were displayed as still images, and photo sets as first photo only. You had to click on the link to see them.
Step by step, bot has started:
- 🎥 Sending attached videos as videos
- 📷📷📷📷 Sending attached multiple photos (twitter lets you attaching up to 4 photos) as media group. Funny thing you probably won't notice: only the first image has denoscription (text of the tweet). This is how Telegram works
- 🔗 Removing the link preview from tweets that don't need it

On this journey, I have also made the format more compact by removing the date and time (I can't adjust it to your local timezone anyway). The link to the tweet is not hidden under the hash sign in brackets: (#)
This media is not supported in your browser
VIEW IN TELEGRAM
Another 🔗 trick you probably didn't notice: if text tweet contains a link, I would like Telegram to generate a preview for it. But Telegram generates a preview for the first link in the message.

So, if text tweet contains a link, it becomes the first link of the message with the invisible character. You can try finding it. :)
While work is ongoing, a bit of explanation on the major difference between Twitter's API v1 and v2.

Basically, V1 used to be a full service furniture shop: you order a bunch of kitchen sets, and they come as sets. This means that each set would contain a table, corresponding chairs, and matching chair pillows (tweet, its attachments and references).

Twitter API V2 serves you more IKEA style: you receive a bunch of tables, and a bunch of chairs. Each table lists chair codes, but it's up to you to find corresponding chairs in the delivery. In some cases, you need to order chair pillows separately, when gathering the set together.

I guess API v2 had same reasons as IKEA: it is much easier to serve this way.

Anyway, I'm on my way - the work is progressing. 🙂
This media is not supported in your browser
VIEW IN TELEGRAM
Fingers crossed, it's ready. It will be sending for a while to a secret Telegram channel, so I can verify that messages sent are identical.

And in some point of time later, when I gain confidence, I will just redirect the new version of the bot to use proper Telegram channels. In the best case, you won't notice anything... except multiple videos in some messages. :)
Well, I was too optimistic. One of the most complex features of consolidating self-replies (or threads) into single messages still misbehaves: instead of a single message, like on the first picture, the bot sends multiple messages, like on the second picture.

I will be debugging it further, but most probably later. :)
I have switched now the new Twitter API v2 bot to post to main channels, and the old version to post to sandbox channel - just to verify the consistency between them. 🤞 Hopefully, you won't notices any changes except seeing tweets with multiple videos.
Please open Telegram to view this post
VIEW IN 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.