In a recent Twitter tirade, President Trump declared he won the presidency no thanks to the news, but through "interviews, speeches and social media."

On the last point, it appears Trump may be right. A study of viral tweets in the run-up to the presidential election showed posts favoring him nearly doubled that of challenger Hillary Clinton, who was three times as likely to be criticized than praised on Twitter in the campaign's final days .

The University of Edinburgh research analyzed the 50 most viral election tweets for each of the final 68 days of the 2016 presidential campaign — Sept. 1 through Nov. 8. The researchers divided the tweets into pro-Clinton and pro-Trump categories and delved into the use of slogans, mentions of swing states and the credibility of linked news sources.

Nearly two-thirds of the 3,450 viral tweets — which were retweeted about 26 million times — either attacked Clinton (39%) or supported Trump (23%). The other third either supported Clinton (14%) or attacked Trump (19%).

Using tweets, researchers frame the narratives and strategies of both campaigns, which include tweets by Stephen King and Jerry Springer.

Here's what else the study found:

Clinton's tweets were often anti-Trump tweets

Most of the viral tweets came from the candidates themselves. Clinton more often criticized Trump than she praised herself.

Clinton sent 331 positive tweets about herself and 363 that attacked Trump in the campaign's final weeks. Meanwhile, Trump boasted about himself 446 times and slammed Clinton 246 times ahead of Election Day.

"This suggests that Clinton expended more energy attacking her opponent than promoting herself, while Trump did the exact opposite," the study said.

But Trump's attacks went further

The president got more bang for his buck with his attacks.

Despite being fewer, his attacks earned more retweets than Clinton's. His posts of self-flattery also had more reach.

NIkki Usher, an associate professor in George Washington University's School of Media and Public Affairs, said this speaks to the lack of enthusiasm around the Clinton campaign. On the other hand, Trump "nailed it," she said, posting tweets bearing all the characteristics of virality: Highly spreadable, emotionally charged statements that resonate.

Trump won the Twitter battle on most days

On about 85% of the days, Trump-friendly tweets were retweeted more than those favoring Clinton.

Still, there were times when pro-Clinton tweets came out on top: The day after the first debate and after the release of a tape showing Trump making sexual comments about women on Access Hollywood.

This illustrates Trump supporters' consistent enthusiasm for their candidate, "regardless to what happens," said lead researcher Walid Magdy of Edinburgh's School of Informatics.

"It was clear from the data how Trump supporters were more dedicated to this campaign compared to Clinton's, who seemed to have many of them supporting her because of hating Trump rather than loving her," he said.

However, Usher cautioned people shouldn't look too deep into the Twitter favor. Twitter, she said, "is not an appropriate stand-in for humanity."

Fake Twitter accounts known as "bots" can influence virality, she said. Twitter also tends to amplify conversations among "elites" such as celebrities, entertainers, politicians and journalists. As a result, such public figures have an outsized presence on the platform

"It's one piece of an overall puzzle of what people are saying about politics or anything else for that matter," she said.

Wikileaks ammo

Among the attacks on Clinton, the ones related to Wikileaks disclosures proved to be the most pervasive on Twitter.

"Wikileaks" was among the top terms used in Clinton attacks along with "crooked," "FBI" and "#DrainTheSwamp." The top three most retweeted Clinton attack tweets were all from the Wikileaks account.

As for Trump, his debate performance was most often the target of ridiculue followed by sexual misconduct accusations.

Among the most retweeted Trump attack tweets was this one from novelist Stephen King: "My newest horror story: Once upon a time there was a man named Donald Trump and he ran for president. Some people wanted him to win."

Clinton fans tweeted more credible news

Pro-Clinton tweets more often came with links to legitimate news websites. The opposite was true of pro-Trump tweets.

The study found a "significantly higher proportion of highly credible websites were linked to" in pro-Clinton tweets.

"The opposite was true for the "support Trump" category, where the majority of links used to support Trump was from mixed credibility websites," the study said.

However, Wikileaks, which has high credibility, according to the study, was the top source used to attack Clinton.

Jerry Springer

The most retweeted tweet supporting Clinton came from former talk show host Jerry Springer, whose midday talk show often broke out into raucous brawls.

"Hillary Clinton belongs in the White House. Donald Trump belongs on my show," received nearly 79,000 retweets.

The most retweeted pro-Trump tweet came from him on Election Day.

"TODAY WE MAKE AMERICA GREAT AGAIN!" he wrote on Nov. 8, earning about 352,000 retweets.

The Edinburgh research will be presented at the Social Informatics 2017 conference in September.

Follow Sean Rossman on Twitter: @SeanRossman