Brittisk man döms till två års fängelse för att ha kommenterat på Facebook.