<commit_before>var httpRequest

prepareTweet()

function makeQuoteRequest () {
  httpRequest = new XMLHttpRequest()
  if (httpRequest) {
    httpRequest.onreadystatechange = updateQuote
    httpRequest.open('GET', 'https://andruxnet-random-famous-quotes.p.mashape.com/', true)
    httpRequest.setRequestHeader('X-Mashape-Key', '<KEY>')
    httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    httpRequest.setRequestHeader('Accept', 'application/json')
    httpRequest.send()
  } else {
    fallBackQuote()
  }
}

function updateQuote () {
  if (httpRequest.readyState === XMLHttpRequest.DONE) {
    if (httpRequest.status === 200) {
      var response = JSON.parse(httpRequest.responseText)
      document.getElementById('quote-box').innerHTML = '<p>"' + response.quote + '"</p>'
      document.getElementById('author-box').innerHTML = '<p>- ' + response.author + '</p>'
      prepareTweet()
    } else {
      fallBackQuote()
    }
  }
}

function fallBackQuote () {
  var quoteObject = quoteArray[Math.floor(Math.random() * quoteArray.length)]
  document.getElementById('quote-box').innerHTML = '<p>' + quoteObject.quote + '</p>'
  document.getElementById('author-box').innerHTML = '<p> - ' + quoteObject.author + '</p>'
  prepareTweet()
}

function prepareTweet () {
  var quoteLink = encodeURIComponent(document.getElementById('quote-box').innerHTML.replace(/<\/?p>/g, ''))
  var authorLink = encodeURIComponent(document.getElementById('author-box').innerHTML.replace(/<\/?p>/g, ''))
  document.getElementById('tweet-button').href = 'https://twitter.com/intent/tweet?text=' + quoteLink + ' ' + authorLink
}
<commit_msg>fixed content special character tweet issue<commit_after>var httpRequest

prepareTweet()

function makeQuoteRequest () {
  httpRequest = new XMLHttpRequest()
  if (httpRequest) {
    httpRequest.onreadystatechange = updateQuote
    httpRequest.open('GET', 'https://andruxnet-random-famous-quotes.p.mashape.com/', true)
    httpRequest.setRequestHeader('X-Mashape-Key', '<KEY>')
    httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
    httpRequest.setRequestHeader('Accept', 'application/json')
    httpRequest.send()
  } else {
    fallBackQuote()
  }
}

function updateQuote () {
  if (httpRequest.readyState === XMLHttpRequest.DONE) {
    if (httpRequest.status === 200) {
      var response = JSON.parse(httpRequest.responseText)
      document.getElementById('quote-box').innerHTML = '<p>"' + response.quote + '"</p>'
      document.getElementById('author-box').innerHTML = '<p>- ' + response.author + '</p>'
      prepareTweet()
    } else {
      fallBackQuote()
    }
  }
}

function fallBackQuote () {
  var quoteObject = quoteArray[Math.floor(Math.random() * quoteArray.length)]
  document.getElementById('quote-box').innerHTML = '<p>' + quoteObject.quote + '</p>'
  document.getElementById('author-box').innerHTML = '<p> - ' + quoteObject.author + '</p>'
  prepareTweet()
}

function prepareTweet () {
  var quoteLink = encodeURIComponent(document.getElementById('quote-box').textContent)
  var authorLink = encodeURIComponent(document.getElementById('author-box').textContent)
  document.getElementById('tweet-button').href = 'https://twitter.com/intent/tweet?text=' + quoteLink + ' ' + authorLink
}

{'fraction_non_alphanumeric': 0.16424242424242425, 'fraction_numerical': 0.0018181818181818182, 'mean_word_length': 4.46523178807947, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, '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': '6728636', 'n_tokens_mistral': 1009, 'n_tokens_neox': 991, 'n_words': 151}