Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moteus/lua-gntp
Implementation of Growl Notify Transport Protocol (GNTP) for Lua
https://github.com/moteus/lua-gntp
gntp growl lua
Last synced: 28 days ago
JSON representation
Implementation of Growl Notify Transport Protocol (GNTP) for Lua
- Host: GitHub
- URL: https://github.com/moteus/lua-gntp
- Owner: moteus
- License: mit
- Created: 2015-03-30T11:10:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-16T12:02:28.000Z (about 8 years ago)
- Last Synced: 2024-10-05T06:41:11.808Z (about 1 month ago)
- Topics: gntp, growl, lua
- Language: Lua
- Homepage:
- Size: 61.5 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lua-gntp
[![Build Status](https://travis-ci.org/moteus/lua-gntp.svg?branch=master)](https://travis-ci.org/moteus/lua-gntp)
[![Coverage Status](https://coveralls.io/repos/moteus/lua-gntp/badge.svg)](https://coveralls.io/r/moteus/lua-gntp)
[![License](http://img.shields.io/badge/License-MIT-brightgreen.svg)](LICENSE)Implementation of Growl Notify Transport Protocol (GNTP) for Lua
### Make common GNTP objects
```Lua
local icon = GNTP.Resource.load_from_file('coulson.jpg')local app = GNTP.Application.new{'LLUV_GNTP', icon = icon,
notifications = {
{ 'CONNECT',
title = 'ConnectTitle',
display = 'ConnectDisplay',
enabled = true,
icon = icon
};
{ 'DISCONNECT',
title = 'DisconnectTitle',
display = 'DisconnectDisplay',
enabled = true,
icon = icon
};
}
}
```### Using lluv async connector
```Lua
local growl = GNTP.Connector.lluv(app, {
host = '127.0.0.1';
port = '23053';
pass = '123456';
encrypt = 'AES';
hash = 'SHA256';
})growl:register(function(self, err, msg)
print(err or msg:encode())
growl:notify('CONNECT', 'User connected',
function(self, err, msg)
print(err or msg:encode())
end
)
end)
```### Using LuaSocket sync connector
```Lua
local growl = GNTP.Connector.luasocket(app, {
host = '127.0.0.1';
port = '23053';
pass = '123456';
encrypt = 'AES';
hash = 'SHA256';
})local msg, err = growl:register()
print(err or msg:encode())local msg1, msg2 = growl:notify('CONNECT', {'User connected', callback = true})
if not msg1 then print(msg2)
else
print(msg1:encode())
print(msg2 and msg2:encode())
end
```