{"id":13414075,"url":"https://github.com/gregdel/pushover","last_synced_at":"2025-04-04T09:10:01.689Z","repository":{"id":27540220,"uuid":"31021653","full_name":"gregdel/pushover","owner":"gregdel","description":"Go wrapper for the Pushover API","archived":false,"fork":false,"pushed_at":"2024-04-29T11:07:01.000Z","size":62,"stargazers_count":140,"open_issues_count":1,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-07-31T20:53:21.377Z","etag":null,"topics":["api-client","api-wrapper","go","golang","hacktoberfest","push-notifications","pushover"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregdel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-19T15:30:05.000Z","updated_at":"2024-07-26T23:16:58.000Z","dependencies_parsed_at":"2024-05-03T10:51:40.525Z","dependency_job_id":null,"html_url":"https://github.com/gregdel/pushover","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregdel%2Fpushover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregdel%2Fpushover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregdel%2Fpushover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregdel%2Fpushover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregdel","download_url":"https://codeload.github.com/gregdel/pushover/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149505,"owners_count":20891954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","api-wrapper","go","golang","hacktoberfest","push-notifications","pushover"],"created_at":"2024-07-30T20:01:56.961Z","updated_at":"2025-04-04T09:10:01.664Z","avatar_url":"https://github.com/gregdel.png","language":"Go","readme":"pushover\n=========\n\n[![GoDoc](https://godoc.org/github.com/gregdel/pushover?status.svg)](http://godoc.org/github.com/gregdel/pushover)\n[![Build Status](https://travis-ci.org/gregdel/pushover.svg?branch=master)](https://travis-ci.org/gregdel/pushover)\n[![Coverage Status](https://coveralls.io/repos/gregdel/pushover/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/gregdel/pushover?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/gregdel/pushover)](https://goreportcard.com/report/github.com/gregdel/pushover)\n\npushover is a wrapper around the Superblock's Pushover API written in go.\nBased on their [documentation](https://pushover.net/api). It's a convenient way to send notifications from a go program with only a few lines of code.\n\n## Messages\n\n### Send a simple message\n\nHere is a simple example for sending a notification to a recipient. A recipient can be a user or a group. There is no real difference, they both use a notification token.\n\n```go\npackage main\n\nimport (\n    \"log\"\n\n    \"github.com/gregdel/pushover\"\n)\n\nfunc main() {\n    // Create a new pushover app with a token\n    app := pushover.New(\"uQiRzpo4DXghDmr9QzzfQu27cmVRsG\")\n\n    // Create a new recipient\n    recipient := pushover.NewRecipient(\"gznej3rKEVAvPUxu9vvNnqpmZpokzF\")\n\n    // Create the message to send\n    message := pushover.NewMessage(\"Hello !\")\n\n    // Send the message to the recipient\n    response, err := app.SendMessage(message, recipient)\n    if err != nil {\n        log.Panic(err)\n    }\n\n    // Print the response if you want\n    log.Println(response)\n}\n```\n\n### Send a message with a title\n\nThere is a simple way to create a message with a title. Instead of using pushover.NewMessage you can use pushover.NewMessageWithTitle.\n\n```go\nmessage := pushover.NewMessageWithTitle(\"My awesome message\", \"My title\")\n```\n\n### Send a fancy message\n\nIf you want a more detailed message you can still do it.\n\n```go\nmessage := \u0026pushover.Message{\n    Message:     \"My awesome message\",\n    Title:       \"My title\",\n    Priority:    pushover.PriorityEmergency,\n    URL:         \"http://google.com\",\n    URLTitle:    \"Google\",\n    Timestamp:   time.Now().Unix(),\n    Retry:       60 * time.Second,\n    Expire:      time.Hour,\n    DeviceName:  \"SuperDevice\",\n    CallbackURL: \"http://yourapp.com/callback\",\n    Sound:       pushover.SoundCosmic,\n}\n```\n\n### Send a message with an attachment\n\nYou can send an image attachment along with the message.\n\n```go\nfile, err := os.Open(\"/some/image.png\")\nif err != nil {\n  panic(err)\n}\ndefer file.Close()\n\nmessage := pushover.NewMessage(\"Hello !\")\nif err := message.AddAttachment(file); err != nil {\n  panic(err)\n}\n```\n\n## Callbacks and receipts\n\nIf you're using an emergency notification you'll have to specify a retry period and an expiration delay. You can get the receipt details using the token in the message response.\n\n\n```go\n...\nresponse, err := app.SendMessage(message, recipient)\nif err != nil {\n    log.Panic(err)\n}\n\nreceiptDetails, err := app.GetReceiptDetails(response.Receipt)\nif err != nil {\n    log.Panic(err)\n}\n\nfmt.Println(\"Acknowledged status :\", receiptDetails.Acknowledged)\n```\n\nYou can also cancel an emergency notification before the expiration time.\n\n```go\nresponse, err := app.CancelEmergencyNotification(response.Receipt)\nif err != nil {\n    log.Panic(err)\n}\n```\n\n## User verification\n\nIf you want to validate that the recipient token is valid.\n\n```go\n...\nrecipientDetails, err := app.GetRecipientDetails(recipient)\nif err != nil {\n    log.Panic(err)\n}\n\nfmt.Println(recipientDetails)\n```\n","funding_links":[],"categories":["Third-party APIs","Go","第三方api","第三方API`第三方API 汇总`","第三方API","\u003cspan id=\"第三方api-third-party-apis\"\u003e第三方API Third-party APIs\u003c/span\u003e","第三方 APIs","Utility"],"sub_categories":["Utility/Miscellaneous","实用程序/Miscellaneous","查询语","HTTP Clients","交流","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","高級控制台界面","Advanced Console UIs","Fail injection","高级控制台界面"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregdel%2Fpushover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregdel%2Fpushover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregdel%2Fpushover/lists"}