feta/instancelocator.go

25 lines
547 B
Go

package main
import (
"fmt"
"github.com/rs/zerolog/log"
"net/http"
"time"
//"github.com/bitly/go-simplejson"
)
const mastodonIndexUrl = "https://instances.social/list.json?q%5Busers%5D=&q%5Bsearch%5D=&strict=false"
const pleromaIndexUrl = "https://distsn.org/cgi-bin/distsn-pleroma-instances-api.cgi"
type InstanceLocator struct {
pleromaIndexLastRefresh *time.Time
mastodonIndexLastRefresh *time.Time
instances map[string]Instance
}
func NewInstanceLocator() *InstanceLocator {
i := new(InstanceLocator)
return i
}