Description Usage Arguments Details Value Note References
Provide a preview image and a widget, plus Twitter Player card metadata and get pack a packaged up, ready-to-deploy archive to deploy and used on Twitter.
1 2 3 4 5 6 7 | card_widget(widget, output_dir = ulid::ulid_generate(),
name_prefix = "wdgtcrd", preview_img,
html_title = class(widget)[[1]], card_twitter_handle = "",
card_title = html_title[[1]], card_description = "",
card_image_url_prefix = "", card_player_url_prefix = "",
card_player_width = 480, card_player_height = 480,
background = "white", bundle_type = c("tgz", "zip"))
|
widget |
an |
output_dir |
the path to save the card-able widget to. If the directory does
not exist it will be created for you (recursively). The value will be
|
name_prefix |
the name-prefix for the widget's |
preview_img |
the path to the local preview image for the card-able widget. This
file must exist and will be copied over to the deployable directory and renamed
(see |
html_title |
the title for the |
card_twitter_handle |
Your twitter handle including the |
card_title, card_description |
The title and description that will be displayed in the tweet |
card_image_url_prefix |
Prefix URL for where you will be copying the preview image to.
Generally, this wil be the same as |
card_player_url_prefix |
Prefix URL for where you will be copying the |
card_player_width, card_player_height |
the width and height for the player window in-tweet. These default to 480x480 and you should review the References section for links to guidelines for Twitter preferred image sizes. |
background |
|
bundle_type |
either |
You can use Twitter's Validator to ensure your creation is usable before trying it in a tweet.
the path.expand()
ed path to the bundle_type
. The archive name will be name_prefix
plus the bundle_type
extension.
You can and should use Twitter's Validator to ensure your creation is usable before trying it in a tweet.
https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/player-card.html
https://sproutsocial.com/insights/social-media-image-sizes-guide/#twitter
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.