Skip to content

Commit

Permalink
Add twitter case
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jul 7, 2017
1 parent 65de0ce commit cd42526
Show file tree
Hide file tree
Showing 4 changed files with 7,845 additions and 6 deletions.
21 changes: 16 additions & 5 deletions src/get-data/rules/author.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,21 @@ module.exports = [
wrap($ => $('[itemprop*="author"] [itemprop="name"]').first().text()),
wrap($ => $('[itemprop*="author"]').first().text()),
wrap($ => $('meta[property="book:author"]').attr('content')),
strict(wrap($ => $('a[class*="author"]').text())),
strict(wrap($ => $('a[class*="author"]').first().text())),
strict(wrap($ => $('[class*="author"] a').first().text())),
strict(wrap($ => $('a[href*="/author/"]').first().text())),
strict(wrap($ => $('a[href*="/author/"]').text())),
strict(wrap($ => $('[class*="author"]').text())),
strict(wrap($ => $('[class*="byline"]').text()))

strict(wrap($ => $('a[href*="/author/"]')
.filter((i, el) => $(el).text().trim())
.first()
.text()
)),

strict(wrap($ => $('[class*="author"]').first().text())),
strict(wrap($ => $('[class*="byline"]').first().text())),

wrap($ => $('.fullname')
.filter((i, el) => $(el).text().trim())
.first()
.text()
)
]
3 changes: 2 additions & 1 deletion src/get-data/rules/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ module.exports = [
wrap($ => $('[class*="date"]').text()),
wrap($ => $('[id*="date"]').text()),
wrap($ => $('[class*="post-timestamp"]').text()),
wrap($ => $('[class*="post-meta"]').text())
wrap($ => $('[class*="post-meta"]').text()),
wrap($ => $('[class*="metadata"]').text())
]
Loading

0 comments on commit cd42526

Please sign in to comment.