I don't know if I understood what you mean "all at once". Maybe you could perform sentiment analisys on each one and find each headline's polarity. If you wanted to view all of todays headlines polarity, then you can just add them up and see if it is negative or not.
This is a just an example:
from textblob import TextBlob
swear_words = # Idk if you are allowed to swear in your answers, even if it is educational :P
loving_words = "I love you very much. You are wonderful."
blob = TextBlob(swear_words)
# If you have negative words in this string then the polarity will be negative.
# I tested some of mine and it printed out -0.46666666666666673
# I included 3 swear words, however I don't know exactly how the polarity is calculated
# but I assume some of it has to do with swears.
print(blob.polarity)
blob2 = TextBlob(loving_words)
print(blob2.polarity) # Prints 0.5866666666666667
Now if you had multiple article headlines and wanted to view it's polarity, you could just append them to a list and view the sum of it.
data = {"results": [{"abstract": ""}, {"abstract": ""}, ..., {"abstract": ""}]}
head_polarities = []
for i in range(len(data["results"]):
blob = TextBlob(data["results"][i]["abstract"])
head_polarities.append(blob.polarity)
total_polarity = sum(head_polarities)
if total_polarity < 0:
print("Negative headlines")
elif total_polarity > 0:
print("Positive headlines")
else:
print("Neutral headlines")
I just noticed you weren't talking about headlines and I don't know what abstracts are, but in theory this should give you an idea of the set's polarity.