A man who threw slate roof tiles at police officers during a nine-hour stand-off in Keighley has been jailed for eight months.