metadata_fetch 0.1.0
metadata_fetch: ^0.1.0 copied to clipboard
A library for fetching metadata from websites
A library for extracing metadata on web pages.
- First, it checks if there are OpenGraph tags present
- If there are missing metadata, it will parse for html
<meta>
and<title>
tags - If none are found, a
Map
will return the url as atitle
and anull
asdescription
.
Usage #
Using this library is very simple.
import 'package:metadata_fetch/metadata_fetch.dart';
main() async {
var data = await MetadataFetch.getMetadata(
"https://flutter.dev/");
// data will always have a title and description, sometimes an image
print(data['title'])
print(data['description'])
print(data['image'])
}
Credit #
This library is inspired by open_graph_parser. However this one tries to be more general.
Roadmap #
- Implement json-ld parser for schema metadata.
Questions, Bugs, and Feature Requests #
Please forward all queries about this project to the issue tracker.