Skip to content

0.9.0

Latest
Compare
Choose a tag to compare
@fmacpro fmacpro released this 14 Nov 18:53
e53e187
  • Allows passing of rules for returning an articles title & contents. This is useful in a case
    where the parser is unable to return the desired title or content e.g.
rules: [
  {
    host: 'www.bbc.co.uk',
    content: () => {
      var j = window.$
      j('article section, article figure, article header').remove()
      return j('article').html()
    }
  },
  {
    host: 'www.youtube.com',
    title: () => {
      return window.ytInitialData.contents.twoColumnWatchNextResults.results.results.contents[0].videoPrimaryInfoRenderer.title.runs[0].text
    },
    content: () => {
      return window.ytInitialData.contents.twoColumnWatchNextResults.results.results.contents[1].videoSecondaryInfoRenderer.description.runs[0].text
    }
  }
]