I have struggled with a slight gambling problem, and I have to say, I completely agree with all of the advice above.
Quit cold turkey, block the sites from your computer, and channel the energy into something else.
But, I don't recommend replacing it with shopping or anything like that. That was my fix, and I am still in debt from that time in my life (more than a year and a half ago and this was just from one month)
My therapist recommended that I find a safe song of sorts, so whenever I get that impulse, I just play a song that puts everything in perspective. You have to find other hobbies or places to channel that energy.
And I like what someone said above: think about what that money or time could be used for.
I know this probably wasn't much help, but just thought I'd try.