Try some code from the internet

This is supposed to backport 1.9.2 URI encode/decode to 1.8.7.
Skeptical.
Try something simpler
Important bug fixes

- Don't mess with Time as this causes Time.now to be wrong, and OAuth to
  fail as a result
- Make sure you're calling #first on an actual Array, as String also
  responds_to?(:first)
- Sub the '+' character in encoded urls