Title: | Lightweight Wrapper to the 'ntfy.sh' Service |
---|---|
Description: | The 'ntfy' (pronounce: notify) service is a simple HTTP-based pub-sub notification service. It allows you to send notifications to your phone or desktop via scripts from any computer, entirely without signup, cost or setup. It's also open source if you want to run your own. Visit <https://ntfy.sh> for more details. |
Authors: | Jonathan Carroll [aut, cre] , Andrew Heiss [ctb] |
Maintainer: | Jonathan Carroll <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.6 |
Built: | 2024-11-06 22:23:06 UTC |
Source: | https://github.com/jonocarroll/ntfy |
Emoji symbols available in ntfy
emoji
emoji
emoji
A data frame with 7,240 rows and 60 columns:
Symbol
Name of the emoji that can be used in a tag
Alternative names
Category
Description
Unicode Version
...
https://github.com/binwiederhier/ntfy/blob/main/web/src/app/emojis.js
Get the ntfy authorization indicator
ntfy_auth(var = "NTFY_AUTH")
ntfy_auth(var = "NTFY_AUTH")
var |
environment variable in which the ntfy authorization indicator is stored |
a logical that indicates if password authorization is used
Notify Completion of a Process
ntfy_done( x, message = paste0("Process completed at ", Sys.time()), title = "ntfy_done()", tags = "white_check_mark", topic = ntfy_topic(), server = ntfy_server(), auth = ntfy_auth(), username = ntfy_username(), password = ntfy_password(), ... )
ntfy_done( x, message = paste0("Process completed at ", Sys.time()), title = "ntfy_done()", tags = "white_check_mark", topic = ntfy_topic(), server = ntfy_server(), auth = ntfy_auth(), username = ntfy_username(), password = ntfy_password(), ... )
x |
a result (ignored) |
message |
text to send as notification |
title |
title of notification. See https://docs.ntfy.sh/publish/#message-title |
tags |
text tags or emoji shortcodes from https://docs.ntfy.sh/emojis/, provided as a list |
topic |
subscribed topic to which to send notification |
server |
ntfy server |
auth |
logical indicating if the topic requires password authorization |
username |
username with access to a protected topic. |
password |
password with access to a protected topic. |
... |
other arguments passed to |
the input x (for further piping) plus a notification will be sent
# report that a process has completed Sys.sleep(3) |> ntfy_done("Woke up")
# report that a process has completed Sys.sleep(3) |> ntfy_done("Woke up")
Notify Completion of a Process with Timing
ntfy_done_with_timing( x, message = paste0("Process completed in ", time_result, "s"), title = "ntfy_done_with_timing()", tags = "stopwatch", topic = ntfy_topic(), server = ntfy_server(), auth = ntfy_auth(), username = ntfy_username(), password = ntfy_password(), ... )
ntfy_done_with_timing( x, message = paste0("Process completed in ", time_result, "s"), title = "ntfy_done_with_timing()", tags = "stopwatch", topic = ntfy_topic(), server = ntfy_server(), auth = ntfy_auth(), username = ntfy_username(), password = ntfy_password(), ... )
x |
expression to be evaluated and timed |
message |
text to send as notification |
title |
title of notification. See https://docs.ntfy.sh/publish/#message-title |
tags |
text tags or emoji shortcodes from https://docs.ntfy.sh/emojis/, provided as a list |
topic |
subscribed topic to which to send notification |
server |
ntfy server |
auth |
logical indicating if the topic requires password authorization |
username |
username with access to a protected topic. |
password |
password with access to a protected topic. |
... |
other arguments passed to |
the result of evaluating x (for further piping) plus a notification will be sent
# report that a process has completed, and how long it took Sys.sleep(3) |> ntfy_done_with_timing()
# report that a process has completed, and how long it took Sys.sleep(3) |> ntfy_done_with_timing()
Retrieve History of Notifications
ntfy_history( since = "all", topic = ntfy_topic(), server = ntfy_server(), auth = ntfy_auth(), username = ntfy_username(), password = ntfy_password(), ... )
ntfy_history( since = "all", topic = ntfy_topic(), server = ntfy_server(), auth = ntfy_auth(), username = ntfy_username(), password = ntfy_password(), ... )
since |
duration (e.g. |
topic |
subscribed topic to which to send notification |
server |
ntfy server |
auth |
logical indicating if the topic requires password authorization |
username |
username with access to a protected topic. |
password |
password with access to a protected topic. |
... |
any other (named) query parameters to add to the request |
a data.frame()
with one row per notification, with columns as
described in the documentation
https://ntfy.sh/docs/subscribe/api/#json-message-format
# get the last hour of notifications ntfy_history(since = "1h")
# get the last hour of notifications ntfy_history(since = "1h")
Get the ntfy password
ntfy_password(var = "NTFY_PASSWORD")
ntfy_password(var = "NTFY_PASSWORD")
var |
environment variable in which the password is stored |
the password for the username with access to the protected ntfy topic
Send a Notification
ntfy_send( message = "test", title = NULL, tags = NULL, priority = 3, actions = NULL, click = NULL, image = NULL, attach = NULL, filename = NULL, delay = NULL, email = NULL, topic = ntfy_topic(), server = ntfy_server(), auth = ntfy_auth(), username = ntfy_username(), password = ntfy_password() )
ntfy_send( message = "test", title = NULL, tags = NULL, priority = 3, actions = NULL, click = NULL, image = NULL, attach = NULL, filename = NULL, delay = NULL, email = NULL, topic = ntfy_topic(), server = ntfy_server(), auth = ntfy_auth(), username = ntfy_username(), password = ntfy_password() )
message |
text to send as notification |
title |
title of notification. See https://docs.ntfy.sh/publish/#message-title |
tags |
text tags or emoji shortcodes from https://docs.ntfy.sh/emojis/, provided as a list |
priority |
Message priority with 1=min, 3=default and 5=max. See https://docs.ntfy.sh/publish/#message-priority |
actions |
Custom user action buttons for notifications. See https://docs.ntfy.sh/publish/#action-buttons |
click |
Website opened when notification is clicked. See https://docs.ntfy.sh/publish/#click-action |
image |
Image to include in the body of the notification. Either a |
attach |
URL of an attachment, see attach via URL. See https://docs.ntfy.sh/publish/#attach-file-from-url |
filename |
File name of the attachment |
delay |
Timestamp or duration for delayed delivery |
email |
E-mail address for e-mail notifications?? |
topic |
subscribed topic to which to send notification |
server |
ntfy server |
auth |
logical indicating if the topic requires password authorization |
username |
username with access to a protected topic. |
password |
password with access to a protected topic. |
a httr2::response()
object
# send a message to the default topic ('mytopic') ntfy_send("test from R!") # can use tags (emoji) ntfy_send(message = "sending with tags!", tags = c(tags$cat, tags$dog) )
# send a message to the default topic ('mytopic') ntfy_send("test from R!") # can use tags (emoji) ntfy_send(message = "sending with tags!", tags = c(tags$cat, tags$dog) )
Get the ntfy server
ntfy_server(var = "NTFY_SERVER")
ntfy_server(var = "NTFY_SERVER")
var |
environment variable in which the server URL is stored |
the ntfy server URL
Get the ntfy topic
ntfy_topic(var = "NTFY_TOPIC")
ntfy_topic(var = "NTFY_TOPIC")
var |
environment variable in which the topic is stored |
the ntfy topic to which the user should be subscribed
Get the ntfy username
ntfy_username(var = "NTFY_USERNAME")
ntfy_username(var = "NTFY_USERNAME")
var |
environment variable in which the username is stored |
the username with access to the protected ntfy topic
Show an emoji symbol, or find one by name
show_emoji(name = NULL, search = FALSE)
show_emoji(name = NULL, search = FALSE)
name |
name of emoji to either print or find |
search |
search the |
Emoji are loaded with data("emoji")
and the aliases
column
contains the names compatible with ntfy. Alternative names are
included in the tags
column and these will be searched if the
name is not found in aliases
.
nothing, just prints the emoji if one or more are found
show_emoji("dog") show_emoji("party")
show_emoji("dog") show_emoji("party")
Emoji symbols compatible with ntfy to be used as tags
tags
tags
An object of class list
of length 1855.