A better scheme in the same spirit as yours but with better security would be to take your master password and append the name of the site, say aw3#rTT:gmail.com, an then hash this, and then use a base 92 encoding to map that to letters, digits, and punctuation, and take as many characters of the resulting string as the site allows.
I started to design and build a simple password manager based upon something like that. It would store in a file a list that looked something like this:
0:*.amazon.com
0:*.ycombinator.com
...
When you ask for the password for a given site, it would look through the file matching the URL against the patterns on the right, until it found a match. The input to the hash would be the matching line and your master password.The prefix number is a password revision number. Since the whole line is part of the hash input, changing the revision number changes the generated password.
Then I got 1Password as part of MacHeist, and my simple password manager project pretty much died.