Skip to content

Upload media files to Reddit effortlessly using the platform's native API. Share images, videos, or GIFs

License

Notifications You must be signed in to change notification settings

Mariownyou/go-reddit-uploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-reddit-uploader: Upload media files to Reddit using the platform's native API. Supports images, videos, or GIFs

This package provides only the basic functionality to upload media files to Reddit because at the moment there are no other packages that support native media uploads. If you look for more advanced features, you can use an excellent wrapper go-reddit by vartanbeno.

Installation

go get -u github.com/mariownyou/go-reddit-uploader/reddit_uploader

Usage

package main

import (
    "fmt"
    "github.com/mariownyou/go-reddit-uploader/reddit_uploader"
)

func main() {
    // Create a new uploader
    client, _ := reddit_uploader.New("username", "password", "client_id", "client_secret", "user_agent")

    // Set up the post
    post := reddit_uploader.Submission{
        Subreddit: "subreddit",
        Title: "title",
    }

    err := client.SubmitImage(post, "image.jpg")
    if err != nil {
        panic(err)
    }
}

Uplaoding Videos

err := client.SubmitVideo(post, "video.mp4", "preview.jpg")
if err != nil {
    panic(err)
}

License

License

About

Upload media files to Reddit effortlessly using the platform's native API. Share images, videos, or GIFs

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages