Images Download Tool written in Go
steps to test the idea :
- cURL the webpage
- get the links of all Images
- download all images into a known directory (locally)
Notes :
- regex for all jpg and png files:
[a-zA-Z0-9/_.:-]+.(jpg|png)
- get all image files into array, then loop for download them all
- if the file starts with
//
then replace it withhttps://
or addhttp:
before//
.
I will develop it further to download all images from a website url by crawling its webpages.
build the CLI program using this command
go build main.go
run the tool using this command
./main get https://twitter.com/devabanoub
Video: coding a tool to download all images from a webpage url in Go