func getEvent(provider string, payload chan *Payload) {
	api := GetApi(provider)
	for {
		events, err := api.Get(config.Provider[provider].Url, config.Keyword, config.Nickname, config.Place)
		handleError("Error on getting event from "+provider, err, payload)
		for _, event := range events {
			key := []byte(provider + ":" + fmt.Sprintf("%v", event.Id))
			if event.IsValid(config.Place, config.Taboo) && !boltdb.Exists(key) {
				value, _ := json.Marshal(event)
				boltdb.Put(key, value)
				payload <- ConstructSlackMessage(provider, &event, config)
			}
		}
		time.Sleep(time.Duration(config.Provider[provider].Interval) * time.Second)
	}
}
getEvent gets events from event providers.
API depends on the provider, so the actual implementation to get events is obtained via GetApi(factory method).
package main
import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"os"
	"os/signal"
	"runtime"
	"strings"
	"syscall"
	"time"
	. "github.com/daikikohara/enotify-slack/event"
)
var (
	config = NewConfig("conf.yml")
	logger = NewLogger(config.Logfile)
	boltdb = NewBolt(config.Boltdb.Dbfile, config.Boltdb.Bucketname)
)
func init() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	SetTimezone(config.Timezone)
}
func main() {
	payload := make(chan *Payload)
	for provider, _ := range config.Provider {
		go getEvent(provider, payload)
	}
	go sendEvent(payload)
	shutdownHook()
}