Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

lua-gntp

Build Status Coverage Status License

Implementation of Growl Notify Transport Protocol (GNTP) for Lua

Make common GNTP objects

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

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

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

About

Implementation of Growl Notify Transport Protocol (GNTP) for Lua

Topics

Resources

License

Packages

No packages published
You can’t perform that action at this time.