Two teenagers who raided a newsagents were tracked down as they wearing the same underwear two days later.
Reece Winfield, 18, and Corey Hobson, 17, attacked the shopkeeper during a raid before stealing cigarettes and alcohol.
Minutes later, Winfield took a photo of Hobson posing with the stolen items then posted it on Facebook.
Hobson also commented on a Facebook link to a newspaper article about the robbery, writing: “Hehehe that’s me.”
But it was their underwear, caught on CCTV hanging out above their low-slung trousers, that helped police to track them down.
When they were arrested two days later, they were still wearing the same underwear, Nottinghamshire Police said.
The shopkeeper received minor injuries in the incident at the newsagent in Mansfield on February 5 this year.
The pair also filmed themselves lighting and throwing a homemade petrol bomb in a street in Nottingham in a separate incident.
Hobson, of no fixed abode, and Winfield, of Nottingham, were both sentenced to 32 months for robbery and four months for attempted arson at Nottingham Crown Court on Thursday after pleading guilty at an earlier hearing.
Seventeen-year-old Hobson can be named after Judge Andrew Hamilton agreed to lift restrictions on identifying him following an application by a reporter from the Mansfield Chad newspaper.
Detective Sergeant Phil Sims, of Mansfield CID, said: “These two made it very easy for us to track them down and, in the end, you could say they were well and truly caught with their pants down.
“They obviously thought it was funny to brag about their crime, sparing no thought for their victim, who they left battered and bruised and counting the cost of their theft and damage.”
Neighbourhood Inspector Andy Goodall said: “While there was no damage or injuries caused by the explosion, Winfield and Hobson’s actions showed a reckless disregard for their own and other people’s safety.
“The fact that they filmed their exploits and laughed at the bang suggests they were pretty happy with themselves.
“I doubt they are laughing now.
“It is by no means big or clever to play with fire and certainly not risk to the lives of others.
“Under no circumstances will we tolerate this sort of lawless, dangerous behaviour.”