<commit_before># Description
#   Hubot golang news extension
#
# Configuration:
#   LIST_OF_ENV_VARS_TO_SET
#
# Commands:
#   hubot hello - <what the respond trigger does>
#   orly - <what the hear trigger does>
#
# Notes:
#   <optional notes required for the script>
#
# Author:
#   0x19 <<EMAIL>>

parser = require 'parse-rss'

module.exports = (robot) ->

  robot.respond /gonews/, (res) ->
    url    = "http://golangweekly.com/rss/1b1gb6c4.rss"

    parser url, (err,rss)->
      console.log err if err
      console.log rss

      #for feed in rss[0]
      res.reply rss[0].title
      res.reply rss[0].description

  #robot.respond /hello/, (res) ->
  #  res.reply "hello!"<commit_msg>Just playin<commit_after># Description
#   Hubot golang news extension
#
# Configuration:
#   LIST_OF_ENV_VARS_TO_SET
#
# Commands:
#   hubot hello - <what the respond trigger does>
#   orly - <what the hear trigger does>
#
# Notes:
#   <optional notes required for the script>
#
# Author:
#   0x19 <<EMAIL>>

parser = require 'parse-rss'
HtmlParser = require "htmlparser"

module.exports = (robot) ->

  robot.respond /gonews/, (res) ->
    url    = "http://golangweekly.com/rss/1b1gb6c4.rss"

    parser url, (err,rss)->
      console.log err if err
      console.log rss

      handler = new HTMLParser.DefaultHandler((() ->),
        ignoreWhitespace: true
      )
      parser  = new HTMLParser.Parser handler
      parser.parseComplete rss[0].description

      #for feed in rss[0]
      res.reply handler.dom

  #robot.respond /hello/, (res) ->
  #  res.reply "hello!"
{'fraction_non_alphanumeric': 0.13082322910019145, 'fraction_numerical': 0.012125079770261647, 'mean_word_length': 2.843137254901961, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 22, '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': '4287757', 'n_tokens_mistral': 565, 'n_tokens_neox': 545, 'n_words': 140}