Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kaneshin/gate
🌉 Gate is a proxy server for notification written in Go
https://github.com/kaneshin/gate
facebook go golang line slack
Last synced: about 2 months ago
JSON representation
🌉 Gate is a proxy server for notification written in Go
- Host: GitHub
- URL: https://github.com/kaneshin/gate
- Owner: kaneshin
- License: mit
- Created: 2016-10-08T14:04:16.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2021-01-03T14:37:17.000Z (almost 4 years ago)
- Last Synced: 2024-08-02T15:48:32.120Z (5 months ago)
- Topics: facebook, go, golang, line, slack
- Language: Go
- Homepage:
- Size: 315 KB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gate
Gate posts a message in Slack and LINE.
## Installation
To compile the Gate binaries from source, clone the Gate repository. Then, navigate to the new directory.
```shell
$ git clone https://github.com/kaneshin/gate.git
$ cd gate
```Compile the `gate` and `gatecli` which will be stored it in $GOPATH/bin.
```shell
$ go install
```Finally, make sure that the gate and gatecli binaries are available on your PATH.
## Setup
Gate loads its configuration in ~/.config/gate/config.json as a default. You need to create it then setup your channels' configuration:
```json
{
"gate": {
"scheme": "http",
"host": "0.0.0.0",
"port": 5731,
"client": {
"default": "slack.channel-1"
}
},
"platforms": {
"slack": {
"channel-1": "[YOUR-INCOMING-URL]",
"channel-2": "[YOUR-INCOMING-URL]"
},
"line": {
"service-1": "[YOUR-ACCESS-TOKEN]"
},
"pixela": {
"username/graph-id": "[YOUR-TOKEN]"
}
}
}
```## Usage
### gate
Run the gate server. If neeeded, run the command with argument of configuration path.
```shell
$ gate -config=/path/to/config.json
```### gatecli
First, you need to install the configuration of gate to run `gatecli` via network. You will get the partial configuration of config.json.
```shell
$ curl -sL http://0.0.0.0:5731/config/cli.json > ~/.config/gate/cli.json
```Then, run `gatecli` to post the platforms.
```shell
$ echo "foobar" | gatecli slack.channel-1
$ echo "foobar" | gatecli # You can send a message without argument for the default target in cli.json
```If you'd like to parse another cli.json. Please run the command with arguments like the below.
```
$ echo "foobar" | gatecli -config=/path/to/cli.json slack.channel-2
```#### Slack
You need to get an incoming webhook url what you want to post message before run it.
```shell
$ echo "Hello world!" | gatecli slack.channel-1
```#### LINE
You need to create a service what you want to post message before run it.
```shell
$ echo "Hello world!" | gatecli line.service-1
```#### Pixela
You need to create a graph what you want to update before run it.
Input a quantity from STDIN, then pass it to `gatecli`.
```shell
# i, inc, or increment
$ echo i | gatecli pixela.username/graph-id # to increment of the day# d, dec, or decrement
$ echo d | gatecli pixela.username/graph-id # to decrement of the day$ echo 5 | gatecli pixela.username/graph-id # to assign the quantity of the day
```## License
[The MIT License (MIT)](http://kaneshin.mit-license.org/)
## Author
Shintaro Kaneko