<commit_before>coffee = require 'coffee-script'
Nightmare = require 'nightmare'
{ log, p } = require 'lightsaber'

class GoogleGroup
  read: (groupName) ->
    browser = new Nightmare
    url = "https://groups.google.com/forum/#!forum/#{groupName}"
    browser
    .goto url
    .wait() # '.LOFA24-p-Q'
    .evaluate \
          (-> document.querySelectorAll '.LOFA24-p-Q'),
          (links) -> (log link?.href) for link in links
    .run (err) ->
      if err
        return console.log(err)
      console.log 'Done!'

module.exports = GoogleGroup
<commit_msg>debugging google groups<commit_after>Nightmare = require 'nightmare'
{ log, p } = require 'lightsaber'

class GoogleGroup
  topicSelector = '.LOFA24-rb-h'

  read: (groupName) ->
    browser = new Nightmare
    url = "https://groups.google.com/forum/#!forum/#{groupName}"
    browser
    .goto url
    .wait() # topicSelector (multiple?)
    .screenshot "tmp/#{groupName}" #"-#{(new Date).toISOString()}.png")
    .evaluate \
          (-> document.querySelectorAll '.LOFA24-rb-h'),
          (links) -> log links #(log link.href) for link in links
    .run (err) ->
      if err
        return console.log(err)
      console.log 'Done!'

module.exports = GoogleGroup

{'fraction_non_alphanumeric': 0.15203252032520326, 'fraction_numerical': 0.0065040650406504065, 'mean_word_length': 2.6636904761904763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '2863492', 'n_tokens_mistral': 413, 'n_tokens_neox': 396, 'n_words': 96}