This repository has been archived by the owner on Jun 30, 2023. It is now read-only.
Replies: 2 comments 5 replies
-
@SWalter1 I want to let you know that the image URLs are there. But
require(academictwitteR)
#> Loading required package: academictwitteR
x <- get_all_tweets("from:ScienceMagazine",
start_tweets = "2021-11-01T00:00:00Z", end_tweets = "2021-11-03T00:00:00Z",
n = 15,
context_annotations = TRUE)
#> Warning: Recommended to specify a data path in order to mitigate data loss when
#> ingesting large amounts of data.
#> Warning: Tweets will not be stored as JSONs or as a .rds file and will only be
#> available in local memory if assigned to an object.
#> page_n is limited to 100 due to the restriction imposed by Twitter API
#> query: from:ScienceMagazine
#> Total pages queried: 1 (tweets captured this page: 27).
#> Total tweets captured now reach 15 : finishing collection.
purrr::keep(x$entities$urls, ~"images" %in% colnames(.)) %>% purrr::map_dfr(~.) -> images
images$images %>% purrr::discard(is.null) %>% purrr::map_dfr(~.)
#> url
#> 1 https://pbs.twimg.com/news_img/1456392373404057608/RDlEY3M9?format=jpg&name=orig
#> 2 https://pbs.twimg.com/news_img/1456392373404057608/RDlEY3M9?format=jpg&name=150x150
#> 3 https://pbs.twimg.com/news_img/1456362079045263371/O6OpYWZY?format=jpg&name=orig
#> 4 https://pbs.twimg.com/news_img/1456362079045263371/O6OpYWZY?format=jpg&name=150x150
#> width height
#> 1 715 550
#> 2 150 150
#> 3 715 550
#> 4 150 150 Created on 2021-11-10 by the reprex package (v2.0.0) |
Beta Was this translation helpful? Give feedback.
1 reply
-
I am having problems accessing the image, because when I connect to the url I get a 404 error. I am using this same approach, a few months ago it worked perfectly, but now working on the same data, it is not possible to access the image. Is it an update of the API or the package? @chainsawriot. Thank you very much for any help! |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the solution you'd like
I'm interested in accessing images and noticed that the URLs included in tweets$entities$urls linking to images are missing a file type identifier (e.g. .jpg). Instead, the link leads back to the tweet in which the image is included. It would be great if this could be fixed in the future, thanks!
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions