smms

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 11 Imported by: 0

README

smms-tiny

A tiny go library for uploading local file to sm.ms,which is a free picture bad

Install

$ go get github.com/Stitch-Zhang/smms

Usage

To upload local images to smms you need to generate a smms API TOKEN

generate token

package main

import (
	"fmt"
    
	"github.com/Stitch-Zhang/smms"
)

func main() {
	uploadURL, err := smms.UploadImg("image_path", "API TOKEN")
	if err != nil {
		fmt.Printf("upload failed : %s", err.Error())
		return
	}
	fmt.Printf("uploaded successfully \n url: %s", uploadURL)
}
// if this works uploadURL should be the direct link of your local image in sm.ms

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UploadImg

func UploadImg(filePath, token string) (string, error)

UploadImg upload image to SMMS if operation have completed return uploaded file url accept formats: jpe,jpg,jpeg,gif,png,bmp,ico,svg,svgz,tif,tiff,ai,drw,pct,psp,xcf,psd,raw,webp

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL