TweetBot icon indicating copy to clipboard operation
TweetBot copied to clipboard

Failing to retrieve images from Twitter

Open StephenBass opened this issue 4 years ago • 7 comments

First off, thank you for the amazing bot! Everything is in working order, however, I notice Tweets which include images are not appearing with the image in our Telegram channel. Is there a setting to include images? One example from the Manchester United sample group below shows images working.

Thanks

image

StephenBass avatar Nov 03 '21 01:11 StephenBass

Currently it just displays telegram webview whenever a tweet has an image or a video. It doesn't work every time and it's a very naive approach. I will reimplement that in a different way when I rewrite the bot.

dracarys18 avatar Nov 03 '21 06:11 dracarys18

Thank you for the help, @dracarys18

StephenBass avatar Nov 03 '21 13:11 StephenBass

Still need to think about this. I don't know what's the current media size limit in twitter. But Bot API has 50MB limit for sending the media.So might not be a good idea to send a whole file as the current implementation works well

dracarys18 avatar May 08 '22 19:05 dracarys18

my telegram bot is not yet pulling tweets from twoitter

jayco12 avatar Jul 15 '22 14:07 jayco12

my telegram bot is not yet pulling tweets from twoitter

Can you provide the logs that you are getting and the steps you followed to deploy the bot?

dracarys18 avatar Jul 15 '22 15:07 dracarys18

Building on the Heroku-20 stack-----> Using buildpack: emk/rust-----> Rust app detected-----> Checking for new releases of Rust stable channelinfo: checking for self-updates rustup unchanged - 1.25.1info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' stable-x86_64-unknown-linux-gnu unchanged - rustc 1.62.0 (a8314ef7d 2022-06-27)info: checking for self-updatesinfo: using existing install for 'stable-x86_64-unknown-linux-gnu'info: default toolchain set to 'stable-x86_64-unknown-linux-gnu' stable-x86_64-unknown-linux-gnu unchanged - rustc 1.62.0 (a8314ef7d 2022-06-27)-----> Building application using Cargo Compiling tweet_bot v0.1.0 (/tmp/build_2d8bb7ad)warning: associated function is never used: new --> src/error/tweet_error.rs:22:12 |22 | pub fn new(kind: TweetErrorKind) -> Self { | ^^^ | = note: #[warn(dead_code)] on by defaultwarning: function is never used: get_url_entity --> src/utils.rs:23:14 |23 | pub async fn get_url_entity(tweet: &Tweet) -> Option<String> { | ^^^^^^^^^^^^^^warning: function is never used: get_media_urls --> src/utils.rs:34:14 |34 | pub async fn get_media_urls(tweet: &Tweet) -> Option<Vec<String>> { | ^^^^^^^^^^^^^^warning: tweet_bot (bin "tweet_bot") generated 3 warnings Finished release [optimized] target(s) in 52.12s-----> Discovering process types Procfile declares types -> web, worker-----> Compressing... Done: 4.6M-----> Launching... Released v4 https://shielded-hollows-23459.herokuapp.com/ deployed to HerokuThis app is using the Heroku-20 stack, however a newer stack is available.To upgrade to Heroku-22, see:https://devcenter.heroku.com/articles/upgrading-to-the-latest-stack

This is the log. The steps I followed are below.

I cloned your repository. I logged into heroku. I installed buildpack. Changed key_sample.env to .env I filled the details in.env I pushed the code to heroku and put on dynos.

And when I checked my telegram bot it had not yet started

jayco12 avatar Jul 15 '22 18:07 jayco12

Or can I get an updated version of the code or a step by step video, please

jayco12 avatar Jul 15 '22 19:07 jayco12