27 lines
750 B
Go
27 lines
750 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 photo and cache with URL
|
|
//Create Category (with parent) + add to cache
|
|
//Upload Photo + add to cache
|
|
//Use cached data to correctly build post form submissions
|
|
createImage := wordpress.CreateImage{
|
|
Url: "https://www.slowtwitch.com/articles/images/3/218713-largest_IMG_4527.jpg",
|
|
}
|
|
imageData := createImage.Execute(baseUrl, wordpressKey, wordpressSecret)
|
|
fmt.Println(imageData.Link)
|
|
}
|