~welt/teal

A Go library for pxl.blue.
~welt/teal

New mailing list added

1 year, 8 months ago
~welt/teal-devel

New mailing list added

1 year, 8 months ago

#teal

godoc pkg.go.dev pxl-gophers contributions and issues

This is a simple library for pxl.blue, an image hosting site. Consider this library extremely unstable as pxl.blue and this library are still very early in development.

#Examples

#Logging in, and uploading a file

package main

import (
	"fmt"
	"os"
	"spiderden.net/go/teal"
)

func main() {
	client, _ := teal.Login("username", "password")
	file, _ := os.Open("glenda.png")
	image, _ := client.UploadFile(file, "glenda.png", "install.gent.ooo")
	fmt.Println(image)
}

#Getting an upload key with username and password

package main

import (
	"fmt"
	"spiderden.net/go/teal"
)

func main() {
	client, _ := teal.Login("username", "password")
	fmt.Println(client.UploadKey)
}

#Manually creating a barebones client and uploading a file

package main

import (
	"fmt"
	"os"
	"spiderden.net/go/teal"
)

func main() {
	client := &teal.Client{
		UserAgent: "teal",
		UploadKey: "key",
	}

	file, _ := os.Open("glenda.png")
	url, _ := client.UploadFile(file, "glenda.png", "install.gent.ooo")
	fmt.Println(url)
}