2024-05-07 22:03:15 +00:00
|
|
|
package main
|
|
|
|
|
2024-05-10 20:01:05 +00:00
|
|
|
import (
|
2024-05-14 21:59:04 +00:00
|
|
|
"federated.computer/wp-sync-slowtwitch/services/slowtwitch"
|
2024-05-10 20:01:05 +00:00
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
2024-05-07 22:03:15 +00:00
|
|
|
const baseUrl = "https://go-api-playground.local/wp-json/wp/v2/"
|
2024-05-08 00:52:47 +00:00
|
|
|
const wordpressKey = "admin"
|
|
|
|
const wordpressSecret = "S34E keY1 A1uX 6ncs Rx4T f21W"
|
2024-05-07 22:03:15 +00:00
|
|
|
|
2024-05-14 21:59:04 +00:00
|
|
|
const slowtwitchAdminUser = "admin"
|
|
|
|
const slowtwitchAdminPass = "yxnh93Ybbz2Nm8#mp28zCVv"
|
|
|
|
const slowtwitchDbUrl = "slowtwitch.northend.network"
|
|
|
|
const slowtwitchDbPort = "3306"
|
|
|
|
const slowtwitchDbName = "slowtwitch"
|
|
|
|
|
2024-05-07 22:03:15 +00:00
|
|
|
var appCache AppCache
|
|
|
|
|
|
|
|
func main() {
|
2024-05-09 20:06:01 +00:00
|
|
|
// TODO Use cached data to correctly build post form submissions
|
2024-05-14 21:59:04 +00:00
|
|
|
slowtwitchDB, err := slowtwitch.Connect(slowtwitchAdminUser, slowtwitchAdminPass, slowtwitchDbUrl, slowtwitchDbPort, slowtwitchDbName)
|
2024-05-09 20:06:01 +00:00
|
|
|
|
2024-05-10 20:01:05 +00:00
|
|
|
if err != nil {
|
2024-05-14 21:59:04 +00:00
|
|
|
fmt.Println(err)
|
2024-05-10 20:01:05 +00:00
|
|
|
}
|
|
|
|
|
2024-05-14 21:59:04 +00:00
|
|
|
categories := slowtwitch.GetCategories(slowtwitchDB)
|
2024-05-10 20:01:05 +00:00
|
|
|
|
2024-05-14 21:59:04 +00:00
|
|
|
for _, category := range categories {
|
|
|
|
fmt.Println(category.FullName)
|
|
|
|
}
|
2024-05-10 20:01:05 +00:00
|
|
|
}
|