Changed project structure
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"CatsOfMastodonBotGo/helpers"
|
"CatsOfMastodonBotGo/internal/helpers"
|
||||||
"context"
|
"context"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
@@ -21,6 +21,7 @@ func main() {
|
|||||||
if instance == "" {
|
if instance == "" {
|
||||||
instance = "https://haminoa.net"
|
instance = "https://haminoa.net"
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
err, posts := helpers.GetPosts(ctx, tag, instance)
|
err, posts := helpers.GetPosts(ctx, tag, instance)
|
||||||
@@ -40,7 +41,6 @@ func main() {
|
|||||||
var existingAccountIds = helpers.GetExistingAccountIds(db)
|
var existingAccountIds = helpers.GetExistingAccountIds(db)
|
||||||
var newPosts = helpers.GetNewPosts(existingPostIds, posts)
|
var newPosts = helpers.GetNewPosts(existingPostIds, posts)
|
||||||
var newAccounts = helpers.GetNewAccounts(existingAccountIds, newPosts)
|
var newAccounts = helpers.GetNewAccounts(existingAccountIds, newPosts)
|
||||||
|
|
||||||
|
|
||||||
log.Println("Number of existing posts: ", len(existingPostIds))
|
log.Println("Number of existing posts: ", len(existingPostIds))
|
||||||
log.Println("Number of existing accounts: ", len(existingAccountIds))
|
log.Println("Number of existing accounts: ", len(existingAccountIds))
|
@@ -1,7 +1,7 @@
|
|||||||
package helpers
|
package helpers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"CatsOfMastodonBotGo/models"
|
"CatsOfMastodonBotGo/internal/models"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
@@ -1,7 +1,7 @@
|
|||||||
package helpers
|
package helpers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"CatsOfMastodonBotGo/models"
|
"CatsOfMastodonBotGo/internal/models"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
Reference in New Issue
Block a user