Skip to content

Commit

Permalink
feat: is_canonical
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed Mar 11, 2020
1 parent be5407e commit e6b0377
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/scrap-site.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const fields_presets = {
seo: [
'response.url',
'result.canonical',
'result.is_canonical',
'previousUrl',
'depth',
'response.status',
Expand Down Expand Up @@ -111,6 +112,7 @@ module.exports = async (baseUrl, options = {}) => {
'',
keywords: $('meta[name="keywords"]').attr('content'),
canonical: $('link[rel="canonical"]').attr('href'),
is_canonical: $('link[rel="canonical"]').attr('href') == window.location.href ? 1 : 0,
og_title: $('meta[property="og:title"]').attr('content'),
og_image: $('meta[property="og:image"]').attr('content')
};
Expand Down

0 comments on commit e6b0377

Please sign in to comment.