mkearney / tweetbotornot2

🔍🐦🤖 Detect Twitter Bots!
https://tweetbotornot2.mikewk.com
Other
89 stars 16 forks source link

Error: Missing the following variables: user_id, screen_name, account_created_at, profile_background_url, profile_banner_url, profile_expanded_url, place_full_name, reply_to_status_id, media_type, hashtags, urls_expanded_url, media_expanded_url, ext_media_expanded_url, mentions_user_id, profile_image_url, account_created_at, is_retweet, is_quote, statuses_count, followers_count, friends_count, favourites_count, verified #15

Open weiaiwayne opened 2 years ago

weiaiwayne commented 2 years ago

Trying to use predict_bot() but got the following error:

Error: Missing the following variables: user_id, screen_name, account_created_at, profile_background_url, profile_banner_url, profile_expanded_url, place_full_name, reply_to_status_id, media_type, hashtags, urls_expanded_url, media_expanded_url, ext_media_expanded_url, mentions_user_id, profile_image_url, account_created_at, is_retweet, is_quote, statuses_count, followers_count, friends_count, favourites_count, verified

The data frame returned from the latest version of rtweet seems different from the output from the older version (some columns are nested). Does it have anything to do with the error?

github-actions[bot] commented 2 years ago

Thank you for creating an issue on {tweetbotornot}! I appreciate the feedback!

simonlindgren commented 2 years ago

I am getting this same error about missing variables. Is there any solution? Thanks.

vinciuna commented 2 years ago

issue is with model tweetbotornot_xgb_model call:

twtdat <- rtweet::get_timelines("kearneymw", n = 100, check = FALSE)
"user_id, screen_name, account_created_at, profile_background_url, profile_banner_url, profile_expanded_url, place_full_name, reply_to_status_id, media_type, hashtags, urls_expanded_url, media_expanded_url, ext_media_expanded_url, mentions_user_id, profile_image_url, account_created_at, is_retweet, is_quote, statuses_count, followers_count, friends_count, favourites_count, verified" |> 
stringr::str_split(pattern = ", ")  |> unlist() -> bot_nms
bot_nms[!bot_nms %in% names(twtdat) ]

"user_id" "screen_name" "account_created_at" "profile_background_url" "profile_banner_url" "profile_expanded_url" "place_full_name" "reply_to_status_id" "media_type" "hashtags" "urls_expanded_url" "media_expanded_url" "ext_media_expanded_url" "mentions_user_id" "profile_image_url" "account_created_at" "is_retweet" "is_quote" "statuses_count" "followers_count" "friends_count" "favourites_count" "verified"

dc1023 commented 1 year ago

Hello, I am getting the same issue. Does anybody have a solution for this?

simonlindgren commented 1 year ago

I got this error when running tweetbotornot2 on a server or within a docker image. I believe the error has to do with the script not being able to retrieve twitter data. It works for me if I run it on a local machine, rather than on server/docker.

dc1023 commented 1 year ago

I got this error when running tweetbotornot2 on a server or within a docker image. I believe the error has to do with the script not being able to retrieve twitter data. It works for me if I run it on a local machine, rather than on server/docker.

Thank you for replying!!! Do you mind explaining more about how you run this on a local machine? Do you just collect all the data and store it locally?

simonlindgren commented 1 year ago

Try this code ⚡️ https://gist.github.com/simonlindgren/f16a752f0a2f84743aecec483bc7db13