Skip to content

Commit cd42526

Browse files
committed
Add twitter case
1 parent 65de0ce commit cd42526

File tree

4 files changed

+7845
-6
lines changed

4 files changed

+7845
-6
lines changed

src/get-data/rules/author.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,21 @@ module.exports = [
6363
wrap($ => $('[itemprop*="author"] [itemprop="name"]').first().text()),
6464
wrap($ => $('[itemprop*="author"]').first().text()),
6565
wrap($ => $('meta[property="book:author"]').attr('content')),
66-
strict(wrap($ => $('a[class*="author"]').text())),
66+
strict(wrap($ => $('a[class*="author"]').first().text())),
6767
strict(wrap($ => $('[class*="author"] a').first().text())),
68-
strict(wrap($ => $('a[href*="/author/"]').first().text())),
69-
strict(wrap($ => $('a[href*="/author/"]').text())),
70-
strict(wrap($ => $('[class*="author"]').text())),
71-
strict(wrap($ => $('[class*="byline"]').text()))
68+
69+
strict(wrap($ => $('a[href*="/author/"]')
70+
.filter((i, el) => $(el).text().trim())
71+
.first()
72+
.text()
73+
)),
74+
75+
strict(wrap($ => $('[class*="author"]').first().text())),
76+
strict(wrap($ => $('[class*="byline"]').first().text())),
77+
78+
wrap($ => $('.fullname')
79+
.filter((i, el) => $(el).text().trim())
80+
.first()
81+
.text()
82+
)
7283
]

src/get-data/rules/date.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,6 @@ module.exports = [
5353
wrap($ => $('[class*="date"]').text()),
5454
wrap($ => $('[id*="date"]').text()),
5555
wrap($ => $('[class*="post-timestamp"]').text()),
56-
wrap($ => $('[class*="post-meta"]').text())
56+
wrap($ => $('[class*="post-meta"]').text()),
57+
wrap($ => $('[class*="metadata"]').text())
5758
]

0 commit comments

Comments
 (0)