Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
brahma-dev committed Jul 26, 2022
1 parent 9bbcd31 commit c50211b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
27 changes: 4 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,7 @@ Use NPM to install:

## Usage

var metafetch = require('metafetch');

metafetch.fetch('http://www.facebook.com'[, options], function(err, meta) {
console.log('title: ', meta.title);
console.log('description: ', meta.description);
console.log('type: ', meta.type);
console.log('url: ', meta.url);
console.log('ampURL: ', meta.ampURL);
console.log('siteName: ', meta.siteName);
console.log('charset: ', meta.charset);
console.log('image: ', meta.image);
console.log('meta: ', meta.meta);
console.log('images: ', meta.images);
console.log('links: ', meta.links);
console.log('headers: ', meta.headers);
console.log('language: ', meta.language);
});

#### Or using Promise
import metafetch from 'metafetch';

metafetch.fetch('http://www.facebook.com'[, options]).then(function(meta) {
console.log('title: ', meta.title);
Expand Down Expand Up @@ -67,7 +49,7 @@ Use NPM to install:
Accept: "*/*"
}
}
}, function(err, meta) {
}).then(function(meta) {
console.log('title: ', meta.title);
console.log('description: ', meta.description);
console.log('type: ', meta.type);
Expand All @@ -79,7 +61,7 @@ Use NPM to install:
console.log('meta: ', meta.meta);
console.log('headers: ', meta.headers);
console.log('language: ', meta.language);
});
}).catch(console.error);;

#### Set User Agent across instance

Expand All @@ -92,7 +74,6 @@ Use NPM to install:
* `image` : `og:image` meta tag.
* `url` : Page url or `og:url` meta tag.
* `ampURL` : URL from amphtml tag or null.
* `uri` : Page uri object, parsed by [uri-js](https://github.com/garycourt/uri-js).
* `images` : All images on this page.
* `links` : All links on this page.
* `meta` : All the meta tags that with a `property` or `name` attribute. e.g `<meta property="author" content="Example">`, `<meta name="description" content="Example.">`
Expand All @@ -103,7 +84,7 @@ Use NPM to install:

(The MIT License)

Copyright (c) 2017 Brahma Dev;
Copyright (c) 2022 Brahma Dev;

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "metafetch",
"description": "Metafetch fetches a given URL's title, description, images, links etc.",
"version": "3.0.0",
"version": "3.0.1",
"homepage": "https://github.com/brahma-dev/metafetch",
"repository": {
"type": "git",
Expand Down

0 comments on commit c50211b

Please sign in to comment.