Post-Migrator/main.go

27 lines
750 B
Go
Raw Normal View History

2024-05-07 22:03:15 +00:00
package main
import (
2024-05-08 22:48:13 +00:00
"federated.computer/wp-sync-slowtwitch/services/wordpress"
2024-05-07 22:03:15 +00:00
"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 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
2024-05-08 22:48:13 +00:00
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)
2024-05-07 22:03:15 +00:00
}