oghref_model 3.5.1 copy "oghref_model: ^3.5.1" to clipboard
oghref_model: ^3.5.1 copied to clipboard

Object standarized definition with parser interface for constructing rich information of given URL among various metadata protocols.

Object definition of OGHref #

OGHref model version in pub.dev

This library provides structure of rich information link and parser from HTML documentations.

Usages #

Import dependencies

  1. Add oghref_model into pubspec.yaml
    dependencies:
        oghref_model: # Latest stable version
    
  2. Import package
    import 'package:oghref_model/model.dart';
    
  3. If custom parser implementations required, please also import buffer_parser.dart
    import 'package:oghref_model/buffer_parser.dart';
    

Implementations

See example;

Limitations and restrictions

  • MetaFetch only recognize the first property name prefix in a sequence of <meta> tag in <head>. For example, given a HTML file:

    <head>
        <meta property="og:title" content="Title"/>
        <meta property="twitter:card" content="summary"/>
    </head>
    

    In this case, MetaFetch only recognize og prefix and remaining metadata will be ignored. If preferred to override the first property prefix recognization, please apply this setting in MetaFetch (in this case, Twitter Card):

    MetaFetch()..primaryPrefix = "twitter";
    
  • Unless for testing, URL response's content type must be satisified below:

    • text/html
    • application/xhtml+xml

    Otherwise, MetaFetch refuses to parse properties to MetaInfo.

  • <meta> must be hard-coded in HTML, generated by JavaScript will be ignored.

License #

AGPL 3.0 or later (For import dedicatedly)

MIT (For import with widgets)

0
likes
140
pub points
22%
popularity

Publisher

verified publisherrk0cc.xyz

Object standarized definition with parser interface for constructing rich information of given URL among various metadata protocols.

Repository (GitHub)
View/report issues

Topics

#fetch #http #metadata

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

AGPL-3.0 (LICENSE)

Dependencies

html, http, meta, mime_dart, path, web

More

Packages that depend on oghref_model