Two men have been jailed for four years for using Facebook to incite disorder.