2

我想知道如何将桌面 Growl 通知从我的 Web 应用程序推送给我的 Web 应用程序的用户。如果可能的话,我想使用 javascript,否则像 Ruby 或 PHP 这样的语言将是我的第二选择。

你以前实施过这样的事情吗?怎么做到呢?

4

2 回答 2

1

You can send Growl notifications from Javascript (with a bit of Flash as a helper, but that part is behind the scenes). Here is a test page: http://www.growlforwindows.com/gfw/examples/js/

Note that this only currently works on Windows - the Javascript/Flash support in Growl on the Mac is currently broken as noted here: https://groups.google.com/forum/?fromgroups=#!topic/growl-development/BNF8tcUE1kM

于 2012-12-11T04:12:49.513 回答
1

我想出了如何使用 Ruby 推送 Growl 通知。我还是想找个 JavaScript 解决方案,但是如果没有办法使用 JavaScript,那么这里有一个 Ruby 解决方案:

使用ruby-growl宝石:

gem install ruby-growl

然后在你的 Ruby 脚本中:

require 'ruby-growl'
g = Growl.new "localhost", "ruby-growl", ["ruby-growl Notification"]
g.notify "ruby-growl Notification", "It Came From Ruby-Growl", "Greetings!"

此外,为了使其正常工作,您必须在 Growl 首选项窗格的网络选项卡上启用“侦听传入通知”“允许远程应用程序注册”

于 2011-06-30T20:51:34.453 回答