metascraper-instagram 5.56.2 → 5.58.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/index.js +12 -2
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "metascraper-instagram",
3
3
  "description": "Metascraper rules tailored for Instagram pages — richer metadata than generic HTML parsers.",
4
4
  "homepage": "https://github.com/microlinkhq/metascraper/packages/metascraper-instagram",
5
- "version": "5.56.2",
5
+ "version": "5.58.1",
6
6
  "types": "src/index.d.ts",
7
7
  "main": "src/index.js",
8
8
  "author": {
@@ -46,5 +46,5 @@
46
46
  "test": "NODE_PATH=.. TZ=UTC ava --timeout 15s"
47
47
  },
48
48
  "license": "MIT",
49
- "gitHead": "63168a1c6ab9fa67552a13fd9e4a60ad4c10f953"
49
+ "gitHead": "ba231caba2d7afe37e55921e88a77b02dafcdcf4"
50
50
  }
package/src/index.js CHANGED
@@ -4,11 +4,15 @@ const {
4
4
  $meta,
5
5
  author,
6
6
  date,
7
+ logo,
7
8
  memoizeOne,
8
9
  parseUrl,
9
- title
10
+ title,
11
+ toRule
10
12
  } = require('@metascraper/helpers')
11
13
 
14
+ const toLogo = toRule(logo)
15
+
12
16
  const test = memoizeOne(
13
17
  url => parseUrl(url).domainWithoutSuffix === 'instagram'
14
18
  )
@@ -32,7 +36,13 @@ module.exports = () => {
32
36
  const dateString = `${dateMatch[1]} GMT`
33
37
  return date(new Date(dateString))
34
38
  },
35
- title: ({ htmlDom: $ }) => title($meta('twitter:title')($))
39
+ title: ({ htmlDom: $ }) => title($meta('twitter:title')($)),
40
+ // rel=icon claims 192x192 but the file is 32x32. The 180 apple-touch is real.
41
+ logo: [
42
+ toLogo($ =>
43
+ $('link[rel="apple-touch-icon"][sizes="180x180"]').attr('href')
44
+ )
45
+ ]
36
46
  }
37
47
 
38
48
  rules.test = ({ url }) => test(url)