metascraper-date 5.34.0 → 5.34.2

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/index.js +6 -19
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -10,20 +10,9 @@ const dateRules = () => {
10
10
  toDate($ => $('[itemprop*="date" i]').attr('content')),
11
11
  toDate($ => $('time[itemprop*="date" i]').attr('datetime')),
12
12
  toDate($ => $('time[datetime]').attr('datetime')),
13
- toDate($ => $('meta[name*="dc.date" i]').attr('content')),
14
- toDate($ => $('meta[name*="dcterms.date" i]').attr('content')),
15
- toDate($ => $('[property*="dc:date" i]').attr('content')),
16
13
  toDate($ => $filter($, $('[class*="byline" i]'))),
17
- toDate($ => $filter($, $('[class*="dateline" i]'))),
18
- toDate($ => $filter($, $('[id*="metadata" i]'))),
19
- toDate($ => $filter($, $('[class*="metadata" i]'))), // twitter, move into a bundle of rules
20
14
  toDate($ => $filter($, $('[id*="date" i]'))),
21
15
  toDate($ => $filter($, $('[class*="date" i]'))),
22
- toDate($ => $filter($, $('[id*="post-timestamp" i]'))),
23
- toDate($ => $filter($, $('[class*="post-timestamp" i]'))),
24
- toDate($ => $filter($, $('[id*="post-meta" i]'))),
25
- toDate($ => $filter($, $('[class*="post-meta" i]'))),
26
- toDate($ => $filter($, $('[id*="time" i]'))),
27
16
  toDate($ => $filter($, $('[class*="time" i]')))
28
17
  ]
29
18
  }
@@ -33,13 +22,7 @@ const datePublishedRules = () => {
33
22
  toDate($jsonld('datePublished')),
34
23
  toDate($jsonld('dateCreated')),
35
24
  toDate($ => $('meta[property*="published_time" i]').attr('content')),
36
- toDate($ => $('meta[property*="release_date" i]').attr('content')),
37
25
  toDate($ => $('[itemprop="datepublished" i]').attr('content')),
38
- toDate($ => $('time[datetime][pubdate]').attr('datetime')),
39
- toDate($ => $('meta[name*="dc.date.issued" i]').attr('content')),
40
- toDate($ => $('meta[name*="dc.date.created" i]').attr('content')),
41
- toDate($ => $('[property*="dc:created" i]').attr('content')),
42
- toDate($ => $filter($, $('[id*="publish" i]'))),
43
26
  toDate($ => $filter($, $('[class*="publish" i]')))
44
27
  ]
45
28
  }
@@ -47,13 +30,17 @@ const datePublishedRules = () => {
47
30
  const dateModifiedRules = () => {
48
31
  return [
49
32
  toDate($jsonld('dateModified')),
50
- toDate($ => $('meta[property*="updated_time" i]').attr('content')),
51
33
  toDate($ => $('meta[property*="modified_time" i]').attr('content')),
52
34
  toDate($ => $('[itemprop*="datemodified" i]').attr('content'))
53
35
  ]
54
36
  }
55
37
 
56
- module.exports = ({ datePublished, dateModified } = { datePublished: false, dateModified: false }) => {
38
+ module.exports = (
39
+ { datePublished, dateModified } = {
40
+ datePublished: false,
41
+ dateModified: false
42
+ }
43
+ ) => {
57
44
  const result = {
58
45
  date: dateModifiedRules().concat(datePublishedRules(), dateRules())
59
46
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "metascraper-date",
3
3
  "description": "Get date property from HTML markup",
4
4
  "homepage": "https://nicedoc.io/microlinkhq/metascraper/packages/metascraper-date",
5
- "version": "5.34.0",
5
+ "version": "5.34.2",
6
6
  "main": "index.js",
7
7
  "author": {
8
8
  "email": "hello@microlink.io",
@@ -22,7 +22,7 @@
22
22
  "metascraper"
23
23
  ],
24
24
  "dependencies": {
25
- "@metascraper/helpers": "^5.33.7"
25
+ "@metascraper/helpers": "^5.34.2"
26
26
  },
27
27
  "engines": {
28
28
  "node": ">= 12"
@@ -34,5 +34,5 @@
34
34
  "test": "exit 0"
35
35
  },
36
36
  "license": "MIT",
37
- "gitHead": "28a9f7b05f8f8a2d1551837035dbcffae8f9eaf4"
37
+ "gitHead": "fad7effd648d289673f3e50ce7db34e6d0b0641f"
38
38
  }