convert pbPost to post

This commit is contained in:
Travis Shears 2025-09-28 12:18:33 +02:00
parent 506a12c06c
commit ef5f5e33ab
2 changed files with 34 additions and 12 deletions

View file

@ -2,7 +2,7 @@ package main
import (
"fmt"
"log"
"log/slog"
"gemini_site/internal/microblog"
"gemini_site/internal/pocketbase"
@ -11,14 +11,13 @@ import (
func main() {
pbClient := pocketbase.NewPocketBaseClient()
mb := microblog.NewMicroBlog(pbClient)
res, err := mb.GetRecentPosts(2)
res, err := mb.GetRecentPosts(10)
// res, err := pbClient.GetList("micro_blog_posts", 1, 10, "-posted")
fmt.Println("Getting page 1 of microblog posts")
fmt.Println("Getting page 1 of microblog posts, 10 posts")
// posts, err := client.GetPosts(1)
if err != nil {
log.Printf("Error getting posts: %v", err)
slog.Error("Error getting posts", "error", err)
} else {
fmt.Printf("Got first page of microblog posts\n")
fmt.Printf("First post: %v\n", res)
slog.Info("Got microblog posts", "posts", res)
}
}