Skip to content
/ gleatfy Public

A Gleam client for the ntfy push notification API

License

Notifications You must be signed in to change notification settings

l-x/gleatfy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gleatfy

Package Version Hex Docs

gleam add gleatfy@1
import gleam/hackney
import gleatfy.{
  High, Markdown, View, actions, message, priority, send, tags, title, topic,
}

pub fn main() {
  gleatfy.new()
  |> topic(is: "gleatfy_test_topic")
  |> priority(is: High)
  |> message(is: Markdown(
    "[**gleatfy**](https://github.com/l-x/gleatfy) is a [Gleam](https://gleam.run) client for the [ntfy](https://ntfy.sh) push notification API",
  ))
  |> title(is: "Aufgemerkt!")
  |> tags(are: ["warning", "important"])
  |> actions(are: [
    View("View on GitHub", "https://github.com/l-x/gleatfy", clear_after: True),
    View("Visit ntfy.sh", "https://ntfy.sh", clear_after: False),
    View("Visit gleam.run", "https://gleam.run", clear_after: False),
  ])
  |> send(using: hackney.send)
}

Further documentation can be found at https://hexdocs.pm/gleatfy.

Development

gleam run   # Run the project
gleam test  # Run the tests