<commit_before>// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
const cheerio = require('cheerio')
const shell = require('shelljs')

const genius = require('./secret').genius

console.log('shelljs')
let currentSong = shell.exec('osascript spotify.applescript', {async: true})
currentSong.stdout.on('data', song => {
  console.log(song)
  let geniusHeaders = new Headers()
  geniusHeaders.append('Authorization', `Bearer ${genius.accessToken}`)


  fetch(`http://api.genius.com/search?q=${song}`, {
    method: 'GET',
    headers: geniusHeaders
  })
    .then(function(response) {
      return response.json()
    })
    .then(function(json) {
      return fetch(json.response.hits[0].result.url)
    })
    .then(function(response) {
      return response.text()
    })
    .then(function(text) {
      let $ = cheerio.load(text)
      let lyrics = $('.lyrics').text().trim()
      document.getElementById('lyrics').innerHTML = lyrics
    })
})
<commit_msg>removed js code from lyrics<commit_after>// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
const cheerio = require('cheerio')
const shell = require('shelljs')
const genius = require('./secret').genius

let currentSong = shell.exec('osascript spotify.applescript', {async: true})

currentSong.stdout.on('data', song => {
  console.log(song)
  let geniusHeaders = new Headers()
  geniusHeaders.append('Authorization', `Bearer ${genius.accessToken}`)


  fetch(`http://api.genius.com/search?q=${song}`, {
    method: 'GET',
    headers: geniusHeaders
  })
    .then(function(response) {
      return response.json()
    })
    .then(function(json) {
      return fetch(json.response.hits[0].result.url)
    })
    .then(function(response) {
      return response.text()
    })
    .then(function(text) {
      let $ = cheerio.load(text)
      let lyrics = $('.lyrics').text().trim().replace(/googletag\.cmd\.push\(.*}\);/g, '')
      document.getElementById('lyrics').innerHTML = lyrics
    })
})

{'fraction_non_alphanumeric': 0.15815861440291704, 'fraction_numerical': 0.0009115770282588879, 'mean_word_length': 3.5539419087136928, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4385289', 'n_tokens_mistral': 684, 'n_tokens_neox': 668, 'n_words': 159}