(function() {
  let $grabFromPage = $('div.commentarea div.md')
  let $url = window.location.pathname;
  let textToEval = {};
  $grabFromPage.addClass(function(index){
    return 'reddex' + index;
  });
  $grabFromPage.each(function(index){
    textToEval[$grabFromPage[index].className.split(' ')[1]] = $grabFromPage[index].innerText;
  });
  textToEval.url = $url.split('/')[2]
  console.log(textToEval)
  $.ajax({
    url: 'https://reddex.herokuapp.com/inbound',
    method: 'POST',
    data: textToEval
  })
  .then(function(response){
    console.log(response)
    for(key in response){
      $('.' + key).addClass(function(index){
        if(response[key] <= -.3){
           return 'neg1'
        }
        else if(response[key] > 0.3){
          return 'pos1'
        }
        else{
          return 'neu'
        }
      })
    }
  });
})();

@@ -7,16 +7,256 @@
 ion() %7B%0A
+  chrome.storage.sync.get(%7B%0A    showPositive: false,%0A    showNeutral: false,%0A    showNegative: false,%0A    showAll: true%0A  %7D, function(items) %7B%0A    console.log(items.showPositive, items.showNeutral, items.showNegative, items.showAll);%0A  %7D);%0A
   let $g

add a chrome storage sync get to inject js makes user preferences in chrome storage available