An alleged armed robber was arrested after a witness appeal on the Echo website, a court heard.
Richard 'Dicko' Quarmby is accused of an attempted knifepoint robbery at the Londis store, known locally as Ken's, in Lincoln Avenue, Silksworth.
A man who knew him saw footage of the incident and identified the robber as Quarmby, a jury at Durham Crown Court heard.
Quarmby denies being involved.
Prosecutor Sean Dryden said the shop was targeted at about 6,25am on September 27.
"CCTV footage shows the robber entering the store wearing a black scarf around his face," Mr Dryden told the jury.
"He lunges at the shopkeeper with a bread knife,
"The shopkeeper bravely fights him off, and the robber flees from the store, knocking over a display as he goes.
"Quarmby had spent the previous day at the home of friends.
"The man had gone away earlier that day for one of his regular stints on the rigs.
"Quarmby spent the day and slept overnight at their house.
"During the course of the evening, he told the woman he was going to rob Ken's store because it had a safe and the shopkeeper was alone."
Mr Dryden said that on the morning of the attempted robbery police had tracked the couple's car from their house to a street close to the shop and back again.
The woman told the jury she had known Quarmby for six months.
On the day her husband left for the rigs, Quarmby had rung her and asked to be picked up from Swan Lodge in Sunderland.
The woman said: "He said he would help with the decorating,
"After the decorators went, we took cocaine and we spoke about various things.
"He said he was thinking about robbing Ken's shop."
The woman said she had slept in on the morning of the robbery, but noticed in the afternoon her car had a puncture.
Under cross-examination from Richard Holland, defending, the woman said Quarmby stopped overnight at her house, but the two were not having an affair.
"I think he thinks we are," she added. "I think he has a crush on me."
The woman said her husband was not keen on her contact with Quarmby.
"I'd got clean of the drugs," she said.
"I think my husband knew I was taking drugs behind his back.
"My husband thought I was being over friendly with Dicko."
The husband told the court he had taken an interest in the story on the Echo's website because it was local to him.
"I was in Turkey at the time," he said.
"The internet on the ship is not the best, but when the Echo put up the video I thought it was someone I knew.
"The way the figure was walking and the shape made me think it was Richard Quarmby."
Quarmby, 38, of Porchester Road, Sunderland, denies attempted robbery, taking without the owner's consent, and driving while disqualified, all on September 27.
He made no reply when interviewed by police.
"There is no dispute an attempt was made to rob the store," Mr Dryden told the jury.
"The issue in this case is identification.
"We say it was was Richard Quarmby, he says it was not."