benpate / sherlock

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sherlock

Illustration of Sherlock Holmes and Watson in a train car, by Sidney Paget. From Arthur Conan Doyle's 1892 book 'The Adventure of Silver Blaze'

GoDoc Version Build Status Go Report Card Codecov

Relentless Metadata Inspector

Sherlock is a Go library that inspects a URL for any and all available metadata, pulling from whatever metadata formats are available, and returning it as an ActivityStreams 2.0 document.

The goal is to have a standard interface into all web content, regardless of competing data standards.

Supported Formats

βœ… ActivityPub/ActivityStreams

βœ… MicroFormats

βœ… Open Graph

In Progress

🚧 WebFinger

🚧 JSON-LD (Linked)

🚧 Twitter Metadata

🚧 Microdata

🚧 RDFa

🚧 oEmbed data provider

Using Sherlock

client := sherlock.NewClient()

// If you only have a URL, then pass it in to .Load()
result, err := client.Load("https://my-url-here")

// If you have already downloaded a file, then pass it to .Parse()
result, err := sherlock.ParseHTML("https://original-url", &bytes.Buffer)

Using Sherlock with Hannibal

Sherlock can also be used as an http client for Hannibal, the ActivityPub library for Go. This allows many other online resources to look like they're ActivityPub-enabled.

About

License:Apache License 2.0


Languages

Language:HTML 88.9%Language:Go 11.1%