2024-05-07 22:03:15 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"federated.computer/wp-sync-slowtwitch/services/wordpress"
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
var appCache AppCache
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
//Get user and cache
|
|
|
|
//Get category and cache
|
|
|
|
//Get single category from cache by name
|
|
|
|
//Get tag and cache
|
|
|
|
//Get single tag from cache by name
|
|
|
|
//Get photo and cache with URL
|
|
|
|
//Create Category (with parent) + add to cache
|
|
|
|
//Create Tag + add to cache
|
|
|
|
//Upload Photo + add to cache
|
|
|
|
//Use cached data to correctly build post form submissions
|
|
|
|
|
2024-05-08 00:52:47 +00:00
|
|
|
user, ok := wordpress.GetUser(baseUrl, "Bongo Bangidsn Hobs", wordpressKey, wordpressSecret)
|
|
|
|
if ok {
|
|
|
|
fmt.Println("User found:", user.Name)
|
|
|
|
appCache.SetUser(user)
|
|
|
|
} else {
|
|
|
|
fmt.Println("User not found")
|
2024-05-07 22:03:15 +00:00
|
|
|
}
|
|
|
|
}
|