<commit_before># Description
#  Grab the title of a youtube video
#
# Dependencies:
#  cheerio
#  request
#
# Configuration:
#  None
#
# Commands:
#  None
#
# Notes:
#  youtube sucks
#
# Author:
#  justinwoo

url = require 'url'
path = require 'path'
request = require 'request'
cheerio = require 'cheerio'

module.exports = (robot) ->
  robot.hear /(youtube\.com\/watch\?v=|youtu.be\/)(.+)/i, (msg) ->
    url_parsed = url.parse(msg.match[2])
    getTitle msg, url_parsed.href

getTitle = (msg, url) ->
  muhUrl = "https://youtube.com/watch?v=#{url}"
  request muhUrl, (err, res, body) -><commit_msg>youtube shorts are a thing now<commit_after># Description
#  Grab the title of a youtube video
#
# Dependencies:
#  cheerio
#  request
#
# Configuration:
#  None
#
# Commands:
#  None
#
# Notes:
#  youtube sucks
#
# Author:
#  justinwoo

url = require 'url'
path = require 'path'
request = require 'request'
cheerio = require 'cheerio'

module.exports = (robot) ->
  robot.hear /(youtube\.com\/(?:watch\?v=|shorts\/)|youtu.be\/)(.+)/i, (msg) ->
    url_parsed = url.parse(msg.match[2])
    getTitle msg, url_parsed.href

getTitle = (msg, url) ->
  muhUrl = "https://youtube.com/watch?v=#{url}"
  request muhUrl, (err, res, body) ->
{'fraction_non_alphanumeric': 0.174512987012987, 'fraction_numerical': 0.0016233766233766235, 'mean_word_length': 3.6353383458646618, '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': '7560054', 'n_tokens_mistral': 486, 'n_tokens_neox': 483, 'n_words': 111}