Write a GET request function (like the post request already written) in background.js. It should take in a URL (the endpoint), the payload (messages/credentials), and a callback (a function that does something w/ the response).
After that, write the analyzeSentiment() function that takes in a list of message objects assigns a sign (+/-1) to each emotion category and then sums all the valences. It should return an ordered list of sentiment objects, where each sentiment score is scaled between -100 and 100. Each sentiment object is structured as such: {"sentiment": int(), "message": str(), "received": bool(), "id": int()}
Write a GET request function (like the post request already written) in
background.js
. It should take in a URL (the endpoint), the payload (messages/credentials), and a callback (a function that does something w/ the response).After that, write the
analyzeSentiment()
function that takes in a list of message objects assigns a sign (+/-1) to each emotion category and then sums all the valences. It should return an ordered list of sentiment objects, where each sentiment score is scaled between -100 and 100. Each sentiment object is structured as such:{"sentiment": int(), "message": str(), "received": bool(), "id": int()}