So I needed to do some OAuth in mIRC and decided to try again with this script and I found out why I was having problems before, as you haven't sorted the signature params like http://oauth.net/core/1.0/#sig_norm_param says. A simple $sorttok did the trick. Thanks again.