Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

lists_statuses() does not return tweet photo info if there are multiple photos #459

Closed
smach opened this issue Dec 6, 2020 · 3 comments
Closed
Labels

Comments

@smach
Copy link

smach commented Dec 6, 2020

Problem

lists_statuses() function does not return info about photos in a tweet if the tweet has more than one photo

Expected behavior

Returned data should include a list of all photo URLs if there is more than one photo in the tweet. Other functions in the package do so.

Reproduce the problem

sample1 <- get_timeline("ericfisher") %>%
  filter(status_id == "1335580351616442368")  %>%
  select(screen_name, text, media_url, ext_media_url, media_type)
sample2 <- lists_statuses(slug = "weather", owner_user = "sharon000", n = 1000)  %>%
  filter(status_id == "1335580351616442368")  %>%
  select(screen_name, text, media_url, ext_media_url, media_type)

 sample1$ext_media_url
[[1]]
[1] "http://pbs.twimg.com/media/EojvNehXcAAOCuU.png"
[2] "http://pbs.twimg.com/media/EojvOrWWMAA5Eqe.png"

> sample2$ext_media_url
[[1]]
[1] NA

rtweet version

## copy/paste output
packageVersion("rtweet")

[1] ‘0.7.0’

@llrs llrs mentioned this issue Feb 15, 2021
@llrs llrs added the bug label Feb 18, 2021
@hadley
Copy link
Collaborator

hadley commented Mar 4, 2021

@smach would you mind updating this reprex? Then I can take a look.

@smach
Copy link
Author

smach commented Mar 5, 2021

library(rtweet)
library(dplyr)
sample1 <- get_timeline("MaggieShiltagh") %>%
  filter(status_id == "1367793626034606087")  %>%
  select(screen_name, text, media_url, ext_media_url, media_type)

sample2 <- lists_statuses(slug = "ddj", owner_user = "sharon000", n = 1000)  %>%
  filter(status_id == "1367793626034606087")  %>%
  select(screen_name, text, media_url, ext_media_url, media_type)

sample1$ext_media_url
[[1]]
[1] "http://pbs.twimg.com/media/EvtghlPXIAE5c2g.jpg"
[2] "http://pbs.twimg.com/media/EvtgjWYXYAAT3qV.jpg"

sample2$ext_media_url
[[1]]
[1] NA

@hadley
Copy link
Collaborator

hadley commented Mar 5, 2021

Looks like this is fixed in the dev version 😄

library(rtweet)
library(dplyr, warn.conflicts = FALSE)

sample1 <- get_timeline("MaggieShiltagh") %>%
  filter(status_id == "1367793626034606087")  %>%
  select(screen_name, text, media_url, ext_media_url, media_type)
#> Reading token from ~/Library/Caches/rtweet/auth.rds
sample1$ext_media_url
#> [[1]]
#> [1] "http://pbs.twimg.com/media/EvtghlPXIAE5c2g.jpg"
#> [2] "http://pbs.twimg.com/media/EvtgjWYXYAAT3qV.jpg"

sample2 <- lists_statuses(slug = "ddj", owner_user = "sharon000", n = 1000)  %>%
  filter(status_id == "1367793626034606087")  %>%
  select(screen_name, text, media_url, ext_media_url, media_type)
sample2$ext_media_url
#> [[1]]
#> [1] "http://pbs.twimg.com/media/EvtghlPXIAE5c2g.jpg"
#> [2] "http://pbs.twimg.com/media/EvtgjWYXYAAT3qV.jpg"

Created on 2021-03-05 by the reprex package (v1.0.0)

@hadley hadley closed this as completed Mar 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants