New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gitlab.com/interview95/go-fetch

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitlab.com/interview95/go-fetch

  • v0.0.0-20230124101554-8b01737954a2
  • Source
  • Go
  • Socket score

Version published
Created
Source

Fetch URLs in Go

Notes

I used cobra-cli to implement this command line application because I already knew it and I know it is very convenient and commonly used in the Go community for this type of programs (my personal blog - hosted on IPFS - is made using Hugo, a static sites generator, which command line uses indeed cobra-cli. So, I studied it many years ago and I know how it works).

Build and run Docker

docker build -t cli .
docker run -it -p 8080:80 cli /bin/bash

and then it is possible to call the ready executable with ./fetch

How to use

# ./fetch --help
This command fetches the HTML page from a list of URLs and save them into files locally.

        Example: if fetch from https://www.google.com, then it saves the pointed HTML page into current_path/www.google.com.html

Usage:
   [flags]

Flags:
  -h, --help       help for this command
  -m, --metadata   Visualize additional info about the URLs fetched.

To fetch URLs with metadata:

./fetch --metadata https://www.gazzetta.it

site:  www.gazzetta.it
num_links:  679
images:  361
last_fetch:  Tue Jan 24 2023 02:55 UTC

In any case, the HTML of the web page is saved locally:

root@0cafd40693ff:/app# ls -lrt
...
...
rw-r--r-- 1 root root  435918 Jan 24 02:55 www.gazzetta.it.html

FAQs

Package last updated on 24 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc