metadata_fetch 0.1.1 copy "metadata_fetch: ^0.1.1" to clipboard
metadata_fetch: ^0.1.1 copied to clipboard

outdated

A library for fetching metadata from websites. It parses OpenGraph tags first, then parses HTML meta as a fallback.

Metadata Fetch #

A dart library for extracing metadata on web pages such as OpenGraph, Meta, and soon, Twitter-Cards and json+LD Schemas.

Usage #

Fetch Metadata for a given URL #

import 'package:metadata_fetch/metadata_fetch.dart';

main() async {
  var data = await MetadataFetch.getMetadata("https://flutter.dev/");

  print(data['title']) // Flutter - Beautiful native apps in record time
  print(data['description'])
  print(data['image']) // https://flutter.dev/images/flutter-logo-sharing.png
}

Bad URL #

import 'package:metadata_fetch/metadata_fetch.dart';

main() async {
  var data = await MetadataFetch.getMetadata("https://broken/");

  print(data) // null

}

Credit #

This library is inspired by open_graph_parser. However this one tries to be more general.

Roadmap #

  • Improve Documentation
  • Implement json-ld parser for schema metadata.

Questions, Bugs, and Feature Requests #

Please forward all queries about this project to the issue tracker.

99
likes
0
pub points
91%
popularity

Publisher

unverified uploader

A library for fetching metadata from websites. It parses OpenGraph tags first, then parses HTML meta as a fallback.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

html, http, path, string_validator

More

Packages that depend on metadata_fetch