来自 Web 服务器的咆哮通知
我注意到 Growl 允许从网站发出 Growl 通知。 有人尝试过实施这个吗?
如果是这样,它采取什么形式? 您实现了多用户支持吗? 并且,您能否提供任何代码示例(C# 或 Objective-C 更好,但我并不那么大惊小怪)?
富有的
I notice that Growl allows for the possibility of Growl notifications from a website. Has anyone tried implementing this?
If so, what form did it take? Did you implement multi user support? And, can you provide any code examples (C# or Objective-C would preferable but I'm not that fussed)?
Rich
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有各种语言的 GNTP(Growl 网络传输协议)绑定,绑定列表可以在此处找到 - 这些允许您从 PHP 脚本等发送通知。
我不会直接信任 Growl 的 UDP 系统,而是编写一个接收和存储通知的服务器(可能作为一个小型 Web 应用程序),以及一个定期通过 HTTP 抓取任何新消息并 Growls 的本地脚本。 一点也不复杂,比 UDP 更可靠,并且可以在您的 Growl'ing 机器关闭或无法访问时对消息进行排队。 应该不会花很长时间来实现
基本上,
server.php
在伪 PHP 中(可以使用 Net_Growl):伪 Python 中的
client.py
(可以使用There are GNTP (Growl Network Transport Protocol) bindings for various languages, a list of bindings can be found here - these allow you to send notifications from, say, a PHP script.
I wouldn't trust Growl's UDP system directly, but rather write a server that receives and stores notifications (maybe as a tiny web app), and a local script that routinely grabs any new messages via HTTP and Growls them. Not complicated at all, will be more reliable than UDP, and can queue up messages when your Growl'ing machine is powered-off or unreachable. Shouldn't take long to implement
Basically,
server.php
in pseudo-PHP (which could use Net_Growl):client.py
in pseudo-Python (which could use gntp):