snippet_post | R Documentation |
Send, list, retrieve information or Delete a file.
snippet_post(content, channels, ..., token = Sys.getenv("SLACK_API_TOKEN"))
file_post(file, channels, ..., token = Sys.getenv("SLACK_API_TOKEN"))
file_delete(file, token = Sys.getenv("SLACK_API_TOKEN"))
content |
character, content of snippet |
channels |
character, Channel ID(s) to post file |
... |
arguments to pass to API method. |
token |
Character. Your Slack API token. Default: Sys.getenv("SLACK_API_TOKEN") |
file |
character, file ID |
For a full list of arguments to pass to file methods see here
A list with an additional class corresponding to slack_method
.
## Not run:
tf <- tempfile(fileext = '.r')
cat(
utils::capture.output(utils::sessionInfo()),
file = tf,
sep = '\n'
)
#post the file
file_post(
channels = "general",
token = Sys.getenv('SLACK_API_TOKEN'),
file = tf,
filename = 'sessionInfo.R',
filetype = 'r',
title = 'R sessionInfo'
)
# delete the file
file_delete(file_last())
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.