Image copyright Reuters Image caption Trump's triumph confounded pollsters, pundits and the mainstream media

What part did the media, both mainstream and alternative, play in Donald Trump's election success?

On 30 September 2016, the San Diego Union Tribune made history. For the first time in its 148-year history it endorsed a Democrat candidate, Hillary Clinton.

It was also a first in 126 years for the Arizona Republic.

Donald J Trump was not popular with America's newspapers. Of the 100 top circulation print newspapers, two endorsed him.

More than 200 newspapers supported Clinton, while Trump received the backing of fewer than 20.

And even some of this support was half-hearted, to say the least. The best the Fort Wayne News Sentinel could come up with was "Thank God for Mike Pence".

The Washington Times declared Trump imperfect and acknowledged his "vulgarity and coarseness".

What they did like was the fact that he had "all the right enemies: the pundits, the 'social scientists', the Beltway insiders, the academics and the righteous mongers of failed policies."

His image, they felt, was being painted by a "one-party media".

Trump's victory, then, was a brutal kick in the teeth for those loathed pundits, insiders and "righteous mongers". But it was also a humiliation for the thousands of journalists who had spent months trying to warn the public about Donald J Trump.

This was one almighty, two-fingered salute to much of the "mainstream media".

'The failure of journalism'

Prof Jeff Jarvis - of the Tow-Knight Centre for entrepreneurial journalism, City University New York, and an enthusiastic and active supporter of Hillary Clinton - stated it simply.

"The mere fact of Donald Trump's candidacy is evidence of the failure of journalism," he believes.

He, like many other members of the liberal media class, feels Trump's success is a sign that the media failed to communicate the truth with enough force.

Image copyright Reuters Image caption Running mate Mike Pence got a tacit endorsement from the Fort Wayne News Sentinel

He believes equating the issue of Hillary Clinton's email server with all of the criticisms of Donald Trump in the name of balance was misleading.

The frequent comparison is with the climate change debate and the "balance" of expert opinion. A second (liberal) view is that the media gave Trump far too much unfiltered airtime.

Rather than being appalled, large parts of the audience liked what they were watching. In essence, it's felt that print journalism failed to tell the real story - and that TV gave Trump a free pass.

Whether you agree, it assumes two things. First, that the news industry has a moral purpose. Second, that TV is still the most powerful medium.

Whatever you make of the first statement, the second seems to be truer than many of the digital evangelists would have you believe.

The triumph of television

In 1968 Roger Ailes, the future boss of Fox News, had a problem: how to get Richard Nixon on television without it being controlled and filtered by what he felt was a hostile media.

His solution was to create his own staged Nixon TV specials and offer them to TV stations. Forty-eight years later, CNN was effectively doing the same for Trump - free of charge.

The enthusiasm for Trump at CNN was simple: ratings. Jeff Zucker, the boss of CNN, is also the man who employed him to present The Apprentice when he worked at NBC.

Image copyright Getty Images Image caption Jeff Zucker made Trump a TV star by hiring him for The Apprentice

Zucker, perhaps more than anyone else, turned Trump into a TV star.

Trump's repeated denunciations of CNN following a documentary he felt was deeply flawed rather overlook the success of their relationship. Trump brought CNN ratings in a tough TV market, and he got exposure in return.

No-one knew what he was going to say, so the cameras were never going to cut away. We now have an unpredictable and telegenic president, whom the cameras and ratings will follow wherever he goes.

However, what's strange about Trump's speeches is how much of what he says refers to issues and topics that are not part of the mainstream news agenda.

The 'alt-right' movement

During the summer of 2016, Donald Trump stated again and again that Hillary Clinton "invented Isis". It's not a claim that receives much support in most newspapers or websites.

On Alex Jones' Infowars site, though, it was big news. The site also features claims that Clinton has a secret "Satanic Network" and has Parkinson's disease, as well as dozens of other conspiracy theories.

Analyse Trump's speeches and there are references to dozens of stories that are dismissed by most mainstream media but have enthusiastic support in the growing world of alternative news sources.

Image copyright AP Image caption Steve Bannon (right) was at Trump's side throughout the campaign

And this "fringe" is generating large amounts of traffic. The online analytics company Tubular Insights identified in the middle of the campaign that when it came to online news, the site creating videos that were generating the greatest levels of engagement (likes, shares etc) was Infowars.

Another star of what has become known as the "alt-right" is Breitbart, a news website with an agenda opposed to anything it deems politically correct or multicultural.

It's Alexa online ranking puts it above the LA Times, the New York Post, Vox, Slate and the New Yorker, not to mention CBS, NBC and ABC's news sites.

If you want to understand how close Breitbart is to Trump, look at Steve Bannon, an executive chairman of Breitbart who became the Trump campaign's chief executive.

Bannon is a former employee of Goldman Sachs and has a Harvard MBA. But politically he is at the heart of the anti-establishment, anti-mainstream media right wing of America.

Bannon is a man who also shares all the right enemies. But how do we know people believe him any more than other parts of the media?

'Share of voice'

In the midst of the election campaign, the social media analysts Impact Social studied posts on Twitter and other social media platforms in Florida.

Once they'd stripped out the pundits, journalists and the rest of the chattering classes, they saw Trump was well ahead of Clinton when it came to positive comments. This ran counter to the polls, which were giving Clinton a small lead.

Pollsters would dismiss social media as a self-selecting group that doesn't reflect the whole voting population. But it does perhaps give a clue to the emotional impact of a candidate.

Trump was giving people more to talk about and saying it in a way that resonated. When it came to "share of voice" online, he was winning.

The need for headlines that bring clicks and stories that get shared has changed everything. Dull, balanced articles (like this one) don't provoke fury, laughter or much in the way of emotion.

Trump was simply more entertaining and generating more passion. In a news environment moving from a world of subscriptions and long-term appointments-to-view to the vagaries of clicks, friends' recommendations and Facebook news streams, that makes him a winner.