33 lines
813 B
Go
33 lines
813 B
Go
package main
|
|
|
|
import (
|
|
"federated.computer/wp-sync-slowtwitch/services/wordpress"
|
|
"fmt"
|
|
)
|
|
|
|
const baseUrl = "https://go-api-playground.local/wp-json/wp/v2/"
|
|
const wordpressKey = "admin"
|
|
const wordpressSecret = "S34E keY1 A1uX 6ncs Rx4T f21W"
|
|
|
|
var appCache AppCache
|
|
|
|
func main() {
|
|
//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
|
|
|
|
tag, ok := wordpress.GetTag("golang-tag", baseUrl, wordpressKey, wordpressSecret)
|
|
if ok {
|
|
appCache.SetTag(tag)
|
|
fmt.Println("Found tag:", tag.Name)
|
|
} else {
|
|
fmt.Println("Could not find tag.")
|
|
}
|
|
}
|