https://github.com/benpate/sherlock
https://github.com/benpate/sherlock
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/benpate/sherlock
- Owner: benpate
- License: apache-2.0
- Created: 2023-05-25T15:52:07.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-01T21:50:25.000Z (6 months ago)
- Last Synced: 2025-02-09T00:19:28.839Z (5 months ago)
- Language: HTML
- Size: 1.47 MB
- Stars: 21
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sherlock
[](http://pkg.go.dev/github.com/benpate/sherlock)
[](https://github.com/benpate/sherlock/releases)
[](https://github.com/benpate/sherlock/actions/workflows/go.yml)
[](https://goreportcard.com/report/github.com/benpate/sherlock)
[](https://codecov.io/gh/benpate/sherlock)## 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](https://www.w3.org/TR/activitystreams-core/) document.
The goal is to have a standard interface into all web content, regardless of competing data standards.
### Supported Formats
✅ [ActivityPub](https://www.w3.org/TR/activitypub/)/[ActivityStreams](https://www.w3.org/TR/activitystreams-core/)
✅ [MicroFormats](https://microformats.org)
✅ [Open Graph](https://ogp.me)
### In Progress
🚧 [WebFinger](https://webfinger.net)
🚧 [JSON-LD (Linked)](https://json-ld.org/)
🚧 [Twitter Metadata](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards)
🚧 [Microdata](https://html.spec.whatwg.org/multipage/microdata.html#microdata)
🚧 [RDFa](https://rdfa.info)
🚧 [oEmbed data provider](https://oembed.com)
### Using Sherlock
```go
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](https://github.com/benpate/hannibal), the ActivityPub library for Go. This allows many other online resources to *look like* they're ActivityPub-enabled.