<commit_before>trumpet = require('trumpet')

module.exports = class Parser
  constructor: (@htmlStream) ->

  getYears: (callback = ->) ->
    tr     = trumpet()
    result = years: []

    tr.selectAll '#sheet-menu > div > a', (el) ->
      el.createReadStream().on 'data', (data) ->
        result.years.push data.toString()

    tr.on 'error', callback
    tr.on 'end', ->
      callback null, result

    @htmlStream.pipe tr
<commit_msg>Fix parser selector<commit_after>trumpet = require('trumpet')

module.exports = class Parser
  constructor: (@htmlStream) ->

  getYears: (callback = ->) ->
    tr     = trumpet()
    result = years: []

    tr.selectAll '#sheet-menu > [id^=sheet-button] > a', (el) ->
      el.createReadStream().on 'data', (data) ->
        result.years.push data.toString()

    tr.on 'error', callback
    tr.on 'end', ->
      callback null, result

    @htmlStream.pipe tr

{'fraction_non_alphanumeric': 0.16500553709856036, 'fraction_numerical': 0.0, 'mean_word_length': 2.6747967479674797, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4466020', 'n_tokens_mistral': 304, 'n_tokens_neox': 293, 'n_words': 68}