gochan

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: MIT Imports: 8 Imported by: 0

README

gochan

Download images from 4chan

Features
  1. Download all the images from a 4chan forum.
  2. No dependincies, no extra modules required.
  3. You can import this package into your go project and use it
Building From the source (If you just want an image scrapper and nothing more)
  1. Ensure your go version is >= 1.16
  2. Clone the repository git clone https://github.com/DaKidReturns/gochan
  3. Go into the folder gochan $ cd gochan/example where you will find the example code as main.go
  4. Run go build -o gochan
  5. Now that you have compiled your source you can use it by $ ./gochan [4chan-urlname]
Using the module for your project
  1. Ensure your go version is >= 1.16

  2. Run the command go get github.com/DaKidReturns/gochan

  3. Use it in your project by the import statement

    import "github.com/DaKidReturns/gochan"
    

    or

    import(
     	"github.com/DaKidReturns/gochan"
     )
    

    it will be imported as gochan.

Future Plans
  1. Add a progress bar to show the currently downloading image
  2. Currently it saves the pictures to the Directory (HOME)/Pictures/Gochan and takes only one command line argument
  3. I plan to do something with concurrency in golang, like download multiple files at once. (after I learn concurrency in golang)
  4. Create better Documentation
  5. Add a Logging feature
  6. Add an option for saving to custom directories
Why did I do this?
  1. I wanted to learn golang
  2. I wanted to download all the images from a forum on 4chan the one that contains a lot of technical drawings

So I figured why not create a web scaper for it ;-)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadImages

func DownloadImages(folderName string, strLinks []string, client *http.Client) error

DownloadImages(string,[]string,*http.Client)

func GetFolderName

func GetFolderName(strPtr *string) string

GetFolderName(*string) string - This funtions scans the html to give the folder a meaningful name

func GetImageLinks(strPtr *string) []string

GetImageLinks(*string) []string - The html is sarched for Image links

func GetSource

func GetSource(client *http.Client, url string) (*string, error)

GetSource(*http.Client,string)

func Intro

func Intro()

Prints out a short intro about the application Intro()

func Usage

func Usage()

Prints out the useage Usage()

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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