Skip to content

Simple application that crawls a specific fundraising website and notifies users if there is a new project

License

Notifications You must be signed in to change notification settings

indrasaputra/sulong

Repository files navigation

Sulong

Go Report Card Workflow codecov Maintainability Quality Gate Status Go Reference

Description

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.

Owner

Indra Saputra

Prerequisites

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.

How to Run

  • 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
    

Deployment

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
    

About

Simple application that crawls a specific fundraising website and notifies users if there is a new project

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages