aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client.go7
-rw-r--r--main.go7
2 files changed, 7 insertions, 7 deletions
diff --git a/client.go b/client.go
index 2b00270..f4b74de 100644
--- a/client.go
+++ b/client.go
@@ -146,7 +146,12 @@ func IndexGet(w http.ResponseWriter, r *http.Request, db *sql.DB) {
data.BoardRemainer = make([]int, 0)
}
- //data.InstanceIndex = GetCollectionFromReq("https://fchan.xyz/followers").Items
+ col := GetCollectionFromReq("https://fchan.xyz/followers")
+
+ if len(col.Items) > 0 {
+ data.InstanceIndex = col.Items
+ }
+
data.NewsItems = getNewsFromDB(db, 3)
data.Themes = &Themes
diff --git a/main.go b/main.go
index 140682b..bba9e0f 100644
--- a/main.go
+++ b/main.go
@@ -2811,7 +2811,6 @@ func AddInstanceToIndexDB(db *sql.DB, actor string) {
func GetCollectionFromReq(path string) Collection {
req, err := http.NewRequest("GET", path, nil)
-
CheckError(err, "error with getting collection from req")
req.Header.Set("Accept", activitystreams)
@@ -2826,11 +2825,7 @@ func GetCollectionFromReq(path string) Collection {
var respCollection Collection
- err = json.Unmarshal(body, &respCollection)
-
- if err != nil {
- panic(err)
- }
+ _ = json.Unmarshal(body, &respCollection)
return respCollection
}