On the week marking President Trump's 100 days in office, his mood on Twitter was much less positive than it had been in the previous few weeks.

A sentiment analysis shows these last few months have been a roller coaster of emotion.

Trump's most negative week by far was his second week in office — just after he signed his controversial ban on travelers to the U.S. from seven Muslim-majority countries, and protests broke out nationwide. His most positive weeks included the confirmation and swearing-in of Supreme Court Justice Neil Gorsuch.

How the analysis works

A program called VADER determines the positivity or negativity of the words used in each tweet. It then assigns the tweets a score ranging from -1 to 1 (with 1 being the most positive).

This week (not including Saturday's tweets), Trump landed almost exactly on an average of zero.

Any given week's score might be a balance of extremely positive and extremely negative tweets. For example, this week, happier messages like "A great great honor to welcome & recognize the National Teacher of the Year, as well as the Teacher of the Year from each State & territory!" (scoring a 0.9477) were balanced out by negative tweets like, "Democrats are trying to bail out insurance companies from disastrous #ObamaCare, and Puerto Rico with your tax dollars. Sad!" (scoring a -0.81).

Trump took aim at Democrats on a range of issues. He reiterated his promise to build a wall on the U.S.-Mexico border, though he had backed off of funding demands in order to avoid a government shutdown. Trump also shared a series of videos of himself announcing executive orders, and he continued his push to replace the Affordable Care Act, an effort that has been unsuccessful so far. Much of this is seen as part of the president trying to score a big accomplishment or two before the end of his first 100 days.

So what?

At times, Trump appears to tweet based on what has grabbed his attention (including what happens to be on cable news) at any given moment. Calculating the emotions in Trump's tweets is by no means a reflection of his psyche, but it might tell us something about what sorts of things please him most (getting a Supreme Court justice confirmed), and what sorts of things draw his anger (Democrats in Congress fighting his agenda).

At the very least, it's a fascinating exercise.

But what's perhaps most remarkable about it is that we can do it at all.

"The president is normally encased in a layer of aides and protected, and we know him ... at some remove," said Tom Rosenstiel, executive director of the American Press Institute.

"And in some ways ... it's comforting," Rosenstiel added, "because you don't see them as actual people that much, except when they want you to."

It's true that President Barack Obama was on Twitter, too, but he engaged at the presidential arm's length that Rosenstiel describes. Obama's feed was a sanitized view of the office, full of official photos and health care pitches — rarely with a truly memorable tweet.

Trump's account, meanwhile, offers up one notable tweet after another.

Social media may have allowed Obama to innovate the president's mode of communicating with the public, but Trump has changed the kinds of things the president communicates. With his tweets, he appears to reveal even things that can be unflattering: his fixations, his frustrations -- and the occasional spelling error.

That may seem like a liability, but then again, it also highlights Trump's authenticity — the part of him that so many voters found irresistible.

Copyright 2017 NPR. To see more, visit http://www.npr.org/.