Closed alexpghayes closed 3 years ago
Have you tried something like this?
htmltools::tagList(
lapply(tweet_urls, tweetrmd::tweet_embed)
)
Will give that a shot. Can you explain why that would work/be necessary?
I would like to do this for both tweet_embed()
and tweet_screenshot()
if possible.
Here's an example gist. tweet_embed()
returns htmltools::HTML()
with an html_dependency()
, so the for
loop probably didn't work because it needs to be printed. The htmltools::tagList()
instead collects a list of html objects and outputs it all together at once.
I also demoed in that gist how to grab screenshots for a list of tweets. There a for loop would work, but essentially I'd recommend saving the screenshot to a specific file and then including those images in your markdown programmatically.
Have you tried something like this?
htmltools::tagList( lapply(tweet_urls, tweetrmd::tweet_embed) )
Came in the issues looking for some solution of this kind, this works great. I would add it to the documentation, because it is really useful
And thanks, the package is great !
Suppose I have five tweets. Is there an easy way to programmatically embed them all? Naive for looping didn't work for me.