linkfo 0.0.2 copy "linkfo: ^0.0.2" to clipboard
linkfo: ^0.0.2 copied to clipboard

outdated

Crawls and gathers open graph and twitter cards information from links

linkfo #

Retrieve basic information from links

Getting Started #

install linkfo:

    linkfo: <latest_version>

Linkfo uses sealed unions to handle the case of possible matches:

const url = 'https://www.youtube.com/watch?v=45MIykWJ-C4';

final response = await client.get(Uri.parse(url));
final info = Scraper.parse(body: response.body, url: url);

info.map(
  openGraph: (info) {
    print(info.title);
    // ...
  },
  twitterCards: (info) {
    // ...
  },
  amazon: (info) {
    // ...
  },
);

If you're certain you'll only be encountering one type of protocol, you can use that corresponding parser instead.

const url = 'https://www.imdb.com/title/tt0117500/';

final response = await client.get(Uri.parse(url));
final scraper = TwitterCardsScraper(body: response.body, url: url);
final info = scraper.scrape();

print(info.title);

Note #

This api is in early development and might change drastically as I look for the best way to return parsed information. This includes Twitter cards which are more like sealed unions themselves as they can be only one of four categories.

PRs and Issues welcome

4
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Crawls and gathers open graph and twitter cards information from links

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

collection, flutter, freezed_annotation, html, json_annotation, path

More

Packages that depend on linkfo