open_graph_parser 0.0.6

Open Graph Parser #

A simple library parsing the open graph data of a given URL.

Usage example:

var data = await OpenGraphParser.getOpenGraphData("https://share.jodel.com/post?postId=5bbf7b84ee274646a2d96147&_branch_match_id=536882993144588943")

print(data['image']);

Result is: http://img.jodel.com/5bbf7b84ee274646a2d96147_pp4ELmdCl0PbKDNF_image.jpeg

Required values are at this moment title and image. If they are not present, this library tries to create a fallback using the title tag in head and the first image it can find in the body.

example/example.dart

import '../lib/open_graph_parser.dart';

main() async {
  print(await OpenGraphParser.getOpenGraphData("https://www.youtube.de"));
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  open_graph_parser: ^0.0.6

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:open_graph_parser/open_graph_parser.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
56
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
30
Overall:
Weighted score of the above. [more]
64
Learn more about scoring.

We analyzed this package on Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:open_graph_parser/open_graph_parser.dart.

Health suggestions

Fix lib/open_graph_parser.dart. (-1 points)

Analysis of lib/open_graph_parser.dart reported 2 hints:

line 32 col 37: Use isEmpty instead of length

line 52 col 11: Use isNotEmpty instead of length

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (html, http).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
html ^0.13.3+3 0.13.4+2 0.14.0+2
http >=0.11.3+17 <=0.12.0 0.12.0 0.12.0+2
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.11
csslib 0.15.0 0.16.1
http_parser 3.1.3
meta 1.1.7
path 1.6.2
source_span 1.5.5
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
utf 0.9.0+5

Admin