Read news basis

 Able to read wordpress site

btw the 10 yrs ago package still work properly, amazing...
means the wordpress api did not change a lot and the golang backward
compability is amazing!
This commit is contained in:
2025-01-25 22:05:38 +08:00
parent e055ef27e5
commit ab0a87106b
11 changed files with 185 additions and 19 deletions

View File

@ -7,6 +7,7 @@ import (
func MapAPIs(app *fiber.App, baseURL string) {
api := app.Group(baseURL).Name("API")
{
api.Get("/well-known/sources", getNewsSources)
api.Get("/link/*", getLinkMeta)
}
}

View File

@ -0,0 +1,10 @@
package api
import (
"git.solsynth.dev/hypernet/reader/pkg/internal/services"
"github.com/gofiber/fiber/v2"
)
func getNewsSources(c *fiber.Ctx) error {
return c.JSON(services.NewsSources)
}