Socket
Book a DemoInstallSign in
Socket

github.com/gpahal/snake

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/gpahal/snake

v0.0.0-20190819163047-b8d4b7654000
Source
Go
Version published
Created
Source

snake 🐍

GoDoc

A Go language library for parsing information in a HTML head tag.

Installation

go get github.com/gpahal/snake

Usage

Processing a URL

The snake.ProcessURL function takes a url string and a *http.Client, makes a GET request to the url using the http client and returns a new *snake.Object from the returned HTML. If client is nil, a default client is used.

object, err := snake.ProcessURL("http://ogp.me", nil)

Parsing HTML

The snake.ParseHTML function takes an io.Reader, reads HTML, parses the HTML and returns a new *snake.Object.

resp, _ := http.Get("http://ogp.me")
// ignoring the error and other response attributes (like status code)
// for simplicity
defer resp.Body.Close()

object, err := snake.ParseHTML(resp.Body)

Documentation

The complete API documentation is available on GoDoc.

License

Licensed under the MIT License by Garvit Pahal. See LICENSE file for details.

FAQs

Package last updated on 19 Aug 2019

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.