In S02E03- School Hard, Giles is reading from a book which mentions Spike, and he then says:
He's known as William the Bloody. Earned his nickname by torturing his victims with railroad spikes. Very pleasant.
Which makes sense, however this is from a book and we can't be sure about its accuracy, I'm certainly not entirely convinced as in one of his next major appearances, in S02E10- What's My Line? Part 2, when Drusilla is torturing Angel, this exchange takes place (emphasis mine):
Drusilla: It [Angel's burned skin] makes pretty colours.
Spike: [Snorts derisively] I'll see him die soon enough, never been much for the pre-show.
Pre-show in this case being a euphemism for torture. And if he didn't like it, there's not much use in doing it. Furthermore, much later in S05E07- Fool For Love, we're given contradicting information in a flashback to 1880 when Spike (then William) was still alive:
Female Party Guest: Have you heard? They call him William the Bloody because of his bloody awful poetry.
Male Party Guest: It suits him. I'd rather have a spike through my head than listen to that awful stuff.
Are there any additional sources which can confirm whether Giles' book was correct or not?