diff --git a/mattermost/server/plugin-linux-amd64 b/mattermost/server/plugin-linux-amd64 new file mode 100644 index 0000000..5cde222 --- /dev/null +++ b/mattermost/server/plugin-linux-amd64 Binary files differ diff --git a/mattermost/server/plugin-linux-amd64 b/mattermost/server/plugin-linux-amd64 new file mode 100644 index 0000000..5cde222 --- /dev/null +++ b/mattermost/server/plugin-linux-amd64 Binary files differ diff --git a/mattermost/server/plugin.go b/mattermost/server/plugin.go new file mode 100644 index 0000000..05f8544 --- /dev/null +++ b/mattermost/server/plugin.go @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "net/http" + + "github.com/mattermost/mattermost-server/plugin" +) + +type HelloWorldPlugin struct { + plugin.MattermostPlugin +} + +func (p *HelloWorldPlugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, "Hello, world!") +} + +// This example demonstrates a plugin that handles HTTP requests which respond by greeting the +// world. +func main() { + plugin.ClientMain(&HelloWorldPlugin{}) +} diff --git a/mattermost/server/plugin-linux-amd64 b/mattermost/server/plugin-linux-amd64 new file mode 100644 index 0000000..5cde222 --- /dev/null +++ b/mattermost/server/plugin-linux-amd64 Binary files differ diff --git a/mattermost/server/plugin.go b/mattermost/server/plugin.go new file mode 100644 index 0000000..05f8544 --- /dev/null +++ b/mattermost/server/plugin.go @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "net/http" + + "github.com/mattermost/mattermost-server/plugin" +) + +type HelloWorldPlugin struct { + plugin.MattermostPlugin +} + +func (p *HelloWorldPlugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, "Hello, world!") +} + +// This example demonstrates a plugin that handles HTTP requests which respond by greeting the +// world. +func main() { + plugin.ClientMain(&HelloWorldPlugin{}) +} diff --git a/mattermost/server/plugin.json b/mattermost/server/plugin.json new file mode 100644 index 0000000..796cc21 --- /dev/null +++ b/mattermost/server/plugin.json @@ -0,0 +1,7 @@ +{ + "id": "com.mattermost.server-hello-world", + "name": "Hello World", + "server": { + "executable": "plugin-linux-amd64" + } +} diff --git a/mattermost/server/plugin-linux-amd64 b/mattermost/server/plugin-linux-amd64 new file mode 100644 index 0000000..5cde222 --- /dev/null +++ b/mattermost/server/plugin-linux-amd64 Binary files differ diff --git a/mattermost/server/plugin.go b/mattermost/server/plugin.go new file mode 100644 index 0000000..05f8544 --- /dev/null +++ b/mattermost/server/plugin.go @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "net/http" + + "github.com/mattermost/mattermost-server/plugin" +) + +type HelloWorldPlugin struct { + plugin.MattermostPlugin +} + +func (p *HelloWorldPlugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, "Hello, world!") +} + +// This example demonstrates a plugin that handles HTTP requests which respond by greeting the +// world. +func main() { + plugin.ClientMain(&HelloWorldPlugin{}) +} diff --git a/mattermost/server/plugin.json b/mattermost/server/plugin.json new file mode 100644 index 0000000..796cc21 --- /dev/null +++ b/mattermost/server/plugin.json @@ -0,0 +1,7 @@ +{ + "id": "com.mattermost.server-hello-world", + "name": "Hello World", + "server": { + "executable": "plugin-linux-amd64" + } +} diff --git a/mattermost/server/plugin.tar.gz b/mattermost/server/plugin.tar.gz new file mode 100644 index 0000000..1daac64 --- /dev/null +++ b/mattermost/server/plugin.tar.gz Binary files differ diff --git a/mattermost/server/plugin-linux-amd64 b/mattermost/server/plugin-linux-amd64 new file mode 100644 index 0000000..5cde222 --- /dev/null +++ b/mattermost/server/plugin-linux-amd64 Binary files differ diff --git a/mattermost/server/plugin.go b/mattermost/server/plugin.go new file mode 100644 index 0000000..05f8544 --- /dev/null +++ b/mattermost/server/plugin.go @@ -0,0 +1,22 @@ +package main + +import ( + "fmt" + "net/http" + + "github.com/mattermost/mattermost-server/plugin" +) + +type HelloWorldPlugin struct { + plugin.MattermostPlugin +} + +func (p *HelloWorldPlugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, "Hello, world!") +} + +// This example demonstrates a plugin that handles HTTP requests which respond by greeting the +// world. +func main() { + plugin.ClientMain(&HelloWorldPlugin{}) +} diff --git a/mattermost/server/plugin.json b/mattermost/server/plugin.json new file mode 100644 index 0000000..796cc21 --- /dev/null +++ b/mattermost/server/plugin.json @@ -0,0 +1,7 @@ +{ + "id": "com.mattermost.server-hello-world", + "name": "Hello World", + "server": { + "executable": "plugin-linux-amd64" + } +} diff --git a/mattermost/server/plugin.tar.gz b/mattermost/server/plugin.tar.gz new file mode 100644 index 0000000..1daac64 --- /dev/null +++ b/mattermost/server/plugin.tar.gz Binary files differ diff --git a/php/status-update.php b/php/status-update.php new file mode 100644 index 0000000..4c24c3f --- /dev/null +++ b/php/status-update.php @@ -0,0 +1,20 @@ + NUM_DOORS) die("Invalid door id"); + +if (!isset($_REQUEST['status'])) die("Please send door status"); + +$status = intval($_REQUEST['status']); +if ($status != 0 && $status != 1) die ("Invalid status"); + + +ob_start(); +var_dump($_REQUEST); +$request = ob_get_clean(); + +file_put_contents("/test", $status . "\n" . $request);