THE state of the Scottish ­economy and a surge of online positivity helped Alex Salmond edge the battle of the online minds in a live real-time analysis of social media.

The TheySay sentiment ­examination, which looked at the views contained in more than 240,000 tweets while the second independence referendum was progressing, revealed 52.5 per cent were positive about the First Minister's performance while 47.5 per cent were negative.

His opponent, Better Together chairman Alistair Darling, had a 51.8 per cent approval rating, while 48.2 per cent were negative.

The First Minister outshone his rival on the economy debate, with 37 per cent approving his position while only 25 per cent were strongly in favour of Darling's performance.

But the analysis showed the currency debate still belonged to Mr Darling, with 45 per cent approval of his position, while 41 per cent were positive about Mr Salmond's stance over his Plan B should a currency union not be accepted.

Pioneering technology ­developed by some of the world's leading experts in Computational Linguistics has been used to assess the global attitudes shown towards the debate. Using a highly sophisticated algorithm developed at Oxford University, the team scanned Twitter to gauge how positive and negative the online audience was to the debate.

Mr Darling also scored wins on defence, with 69 per cent approving of his answers while 50 per cent backed Mr Salmond. On the NHS, 53 per cent were positive of Mr Darling's position while 31 per cent supported Salmond and on oil 41 per cent approved of the Better Together leader while 26 per cent were positive about the First Minister.

Dr Karo Moilanen, co-founder of TheySay and visiting academic at Oxford University, said: "It seems Darling spent a lot of time on details while Salmond painted bigger visions. While Darling won a lot of the topics, there were was a bigger raw volume of tweets for Salmond."

London-based TheySay, ­established three years ago by Dr Moilanen and Stephen Pulman, can identify, to a high level of confidence, the main reasons for people's positive or negative comments, the common themes discussed in relation to a topic, and even if the comment was humorous or not.

On Twitter, Ciara McKay said: "@AlexSalmond is running the show. Looks like calm, rational and forward thinking policies will win the day"

Monica Lennon: "A currency union makes sense, says Alex Salmond. I agree. Let's keep the one we have #nothanks."

Jo Edwards: "If projected oil is so low then why not let us keep it Alistair?"

Lynne Brown: "I appreciate apprehension re currency but should we trust Darling? He was involved in running the show when the banks crashed."

Gerry Hassan: "This cross-examination shows the worst of adversarial, male politicians not engaging in substance or listening to each other. "

Conor James Silk: "This is terrible management of a debate by BBC. It's a shouting contest with unbalanced audience."

Rachel Gillon "No winners tonight. A national disgrace."