A student who made racially offensive comments about footballer Fabrice Muamba on Twitter has been jailed for 56 days - the latest case where a comment made on social media has landed someone in court.

Lawyers say there are lots of pieces of UK legislation that can be used to prosecute someone who has fallen foul of the law in the online arena.

So what have people posted that is likely to land them in prison?

Abusive messages

Image caption Liam Stacey admitted a racially aggravated public order offence

It seems Twitter has become a new terrace for footballers and fans to receive abuse, with a series of convictions so far this year.

Liam Stacey sobbed as he was jailedafter drunkenly sending a series of abusive tweets in the aftermath of Bolton player Fabrice Muamba's collapse. Having charged him under the Crime and Disorder Act with making racially aggravated comments, the Crown Prosecution Service said it hoped he served as a warning to people posting comments online.

Last month,Sunderland fan Peter Copeland, 29, received a four-month suspended jail sentenceafter posting racist comments aimed at Newcastle United fans, under the Malicious Communications Act.

And last week law studentJoshua Cryer, 21, admitting bombarding former footballer Stan Collymorewith a series of racist tweets in an attempt to "snare a celebrity" by provoking a reaction. He was charged under section 127 of the Communications Act with sending grossly offensive messages and given a two-year community order.

Commenting after Cryer's conviction, Wendy Williams, head of the CPS in the North East, said: "Ironically, the strongest evidence in each of these cases has been directly provided by the defendants themselves.

"When a person makes such comments digitally, they effectively hand police and prosecutors much of the evidence needed to build a robust case against them."

Ian Kelcey, chairman of the Law Society of England and Wales's criminal law committee says part of the problem is people often send messages without thinking through the consequences.

"It is too easy to press the send button without considering the effect of publication," he says.

Encouraging riots

Image caption Jordan Blackshaw and Perry Sutcliffe-Keenan were jailed for four years

Last summer's riots in England sawtwo people jailed for their posts on social networkingsites despite the fact no trouble was reported in either area.

Jordan Blackshaw, 21, was jailed for four years for encouraging rioting after he created a Facebook event entitled "Smash d[o]wn in Northwich Town.

He was joined by Perry Sutcliffe-Keenan, 22, who invited people to "riot" in Warrington on 10 August.

Both men pleaded guilty under sections 44 and 46 of the Serious Crime Act to intentionally encouraging another to assist the commission of an indictable offence.

The High Court rejected an appeal, saying their offences were not minor simply because they had not gone door-to-door.

Comparing the four-year sentence for encouraging rioting with the 56-day sentence for racially aggravated comments, Kelcey says sentences vary so much because it "depends on the evil they are directed at".

"With the riots there was potential for serious harm and injury. The Muamba tweet was disgusting and offensive but not likely to create greater acts of criminality," he says.

Menacing communications

Image caption Thousands of supporters retweeted Chambers' message

In a moment of frustration Paul Chambers, 27, from Doncaster, sent a tweet reading: "Robin Hood Airport is closed. You've got a week and a bit... otherwise I'm blowing the airport sky high!"

He was convicted of sending "a message of a menacing character", contrary to provisions of the 2003 Communications Act, fined £385 and ordered to pay £600 costs after judges said it was "clearly menacing".

The tweet led to an "I am Spartacus!" campaign backed by broadcaster Stephen Fry and comedians including Al Murray.

Some 4,000 people supported the campaign by tweeting his message and an appeal at the High Court -for which judgement has been reserved- was told that the Crown Court had erred in law and common sense.

Prof Duncan Bloy, a media law expert at Cardiff University's School of Journalism, warns that many people do not know the criminal and civil consequences of making comments on social networking sites.

"There was a survey conducted by one of the big global law firms at the end of last year, it found that 65% of respondents, and they were mainly young people, had no idea of the legal consequences of going online," he says.

One solution might be for social networking sites such as Facebook, Bebo and Twitter to have a warning of what is a criminal offence when people sign up, suggests Julian Young, a solicitor advocate.

"In the 1960s IBM had a slogan, 'Think', and the message was 'Think, therefore IBM'. There needs to be a message to think, to think before you post something online," he says.

Kelcey's advice is that people should ask themselves whether they would be prepared to shout it out in a crowded room.

"If in doubt don't shout should be the bottom line," he says.

Contempt

Image caption Ryan Giggs took out an injunction against the Sun newspaper and TV presenter Imogen Thomas

The viability of injunctions in the age of social media has been challenged by a number of high-profile cases over the last year.

WhenRyan Giggs, aka CTB, asked Twitter to hand over details of users who had broken an injunctionto reveal his identity, hundreds more responded by naming him.

In theory, they were guilty of contempt of court under the law of England and Wales and liable to an unlimited fine or even a two-year prison sentence. But it was suggested by legal analyst Joshua Rozenberg that they would have found safety in numbers.

When it comes to injunctions, Young agrees that once it is out there "unless you close down Twitter and Facebook, there is not much that can be done".

Contempt has also become an issue when high-profile celebrities, with a large number of followers, post something that could them in trouble with the law.

In February,Joey Barton's tweets to 1.3 million users about the trial of footballer John Terrysaw him examined by the attorney general for contempt of court.

The Contempt of Court Act 1981 states that once someone is arrested or charged, there should be no public comments about them which could risk seriously prejudicing their trial.

But Attorney General Dominic Grieve ruled Barton's comments would not compromise the trial.

Libel

On Monday, the first Twitter libel case in England saw former New Zealand cricket captain Chris Cairns awarded £90,000 in damages. He successfully sued Lalit Modi, former chairman of the IPL, over allegations he was involved in match-fixing.

And last year, a councillor in Caerphilly, Wales, was ordered to pay £3,000 and costs to a political rival for posting libellous comments on Twitter.

People need to remember that Twitter and other social networking sites are "published" in much the same way as a newspaper, Kelcey says.

"In fact publications through this type of medium are arguably worse as they stay on the internet for a long time and can be difficult to remove. There is no doubt either as to the author which makes prosecution easier.

"Publications in newspapers have usually gone through an editorial process so the more dangerous remarks are likely to be edited out and there is time for mature reflection before publication," he says.

Young is convinced the only way to get the message across is for the judiciary to come down hard on people who get it wrong.

"The danger of using social media, which has its own codes, without thinking, is that Twitter is available to umpteen million people, so umpteen people might see their comments.

"The judiciary needs to make it plain for people who can't think beyond the next 30 seconds to consider if what they are going to say is an offence," he says.

Reporting by Sarah Bell, Vanessa Barford and Lauren Everitt