scraping

package module
v0.0.0-...-d36503a Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MIT Imports: 8 Imported by: 0

README

Scraping Handler

Build Status coverage GoReport license GitHub go.mod Go version of a Go module GoDoc

Install

# Go 1.16+
go install github.com/vbetsun/scraping@latest

# Go version < 1.16
go get -u github.com/vbetsun/scraping 

Usage

Run program

package main

import (
	"log"
	"net/http"

	"github.com/vbetsun/scraping"
)

func main() {
	http.Handle("/", scraping.Handler())
	log.Fatal(http.ListenAndServe(":3000", nil))
}

Send request

curl --location --request POST 'http://localhost:3000' \
--header 'Content-Type: text/plain' \
--data-raw 'https://google.com
https://example.com'

Example of response

16798

1256

License

Golang Scraping Handler is provided under the MIT License

Documentation

Overview

Package scraping gives a middleware that scraps data from given URLs

Index

Constants

View Source
const LineBreak = "\n"

LineBreak it's OS-specific symbol of new line

View Source
const MaxConnections uint32 = 999

MaxConnections it's maximum of simultaneous connections

Variables

This section is empty.

Functions

func Handler

func Handler() http.Handler

Handler implements a simple handler for scrapping data from given urls

Types

This section is empty.

Directories

Path Synopsis
_examples
basic command
custom-path command

Jump to

Keyboard shortcuts

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