https://github.com/tiendc/go-linkpreview
Link preview and site info library for Go
https://github.com/tiendc/go-linkpreview
link-preview site-info site-scraper url-preview
Last synced: 2 months ago
JSON representation
Link preview and site info library for Go
- Host: GitHub
- URL: https://github.com/tiendc/go-linkpreview
- Owner: tiendc
- License: mit
- Created: 2024-06-19T16:58:03.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-10-30T14:16:22.000Z (8 months ago)
- Last Synced: 2025-10-30T16:28:12.545Z (8 months ago)
- Topics: link-preview, site-info, site-scraper, url-preview
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Go Version][gover-img]][gover] [![GoDoc][doc-img]][doc] [![GoReport][rpt-img]][rpt]
# Link preview and site info scraping library for Go
## Installation
```shell
go get github.com/tiendc/go-linkpreview
```
## Usage
### Simple one
```go
result, err := linkpreview.Parse(url)
// Output:
// {
// "title": ,
// "description": ,
// "og_meta": {},
// "twitter_meta": {},
// }
```
### Parse with configuration
```go
// Get everything
result, err := linkpreview.Parse(url,
linkpreview.ParseOGMeta(true), // default: true
linkpreview.ParseTwitterMeta(true), // default: true
linkpreview.ParseFavicons(true), // default: false
linkpreview.ReturnMetaTags(true), // default: false
linkpreview.ReturnLinkTags(true) // default: false
)
// Output:
// {
// "title": ,
// "description": ,
// "og_meta": {},
// "twitter_meta": {},
// "favicons": [],
// "meta_tags": [],
// "link_tags": [],
// }
```
## Contributing
- You are welcome to make pull requests for new functions and bug fixes.
## Authors
- Dao Cong Tien ([tiendc](https://github.com/tiendc))
## License
- [MIT License](LICENSE)
[doc-img]: https://pkg.go.dev/badge/github.com/tiendc/go-linkpreview
[doc]: https://pkg.go.dev/github.com/tiendc/go-linkpreview
[gover-img]: https://img.shields.io/badge/Go-%3E%3D%201.18-blue
[gover]: https://img.shields.io/badge/Go-%3E%3D%201.18-blue
[rpt-img]: https://goreportcard.com/badge/github.com/tiendc/go-linkpreview
[rpt]: https://goreportcard.com/report/github.com/tiendc/go-linkpreview