Sulong is a simple application that crawls TaniFund's projects, checks if there is new project, then notifies user about the new project (if any) in Telegram channel.
To use this application, make sure you have a Telegram Bot. To avoid DDoS, the application will run once in an hour by default. It can be changed via env configuration.
-
Install Go
This project uses version 1.17. Follow Golang installation guideline.
-
Create your Telegram bot
Read https://telegram.org/blog/bot-revolution.
Follow https://core.telegram.org/bots for developer guide.
-
Clone the project (use one of the two methods below)
Use SSH
$ [email protected]:indrasaputra/sulong.git
Use HTTP
$ https://github.com/indrasaputra/sulong.git
-
Go to project folder
Usually, it would be
$ cd go/src/github.com/indrasaputra/sulong
-
Fill in the environment variables
Copy the sample env file.
$ cp env.sample .env
Then, fill the values according to your setting in
.env
file. -
Download the dependencies
$ make tidy
or run this command if you don't have
make
installed in your local.$ GO111MODULE=on go mod download
-
Run the application
$ go run cmd/main.go
Currently, this project is deployed in one of my server. These are the steps I do for deployment:
-
Build Go binary
$ make compile
-
Copy compiled binary to server
$ scp <source> <target>
Change
<source>
and<target>
according to your environment. You may use identity to access the server. For example:$ scp -i ~/.ssh/myserver sulong [email protected]:/home/indra
-
SSH to server
$ ssh -i ~/.ssh/myserver [email protected]
-
Run binary
$ TELEGRAM_RECIPIENT_ID=1 TELEGRAM_URL=url TELEGRAM_TOKEN=token TANIFUND_URL=url SLEEP=15 PORT=8080 ./sulong