From fc29046f60150f4b8051de9d7ff25d7c5ca584b7 Mon Sep 17 00:00:00 2001 From: Robb Kidd Date: Sun, 26 Apr 2026 14:52:54 -0400 Subject: [PATCH] now it's URI.decode -> Addressable::URI.unescape --- plugins/links.rb | 3 ++- plugins/urban.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/links.rb b/plugins/links.rb index d02e16e..93b75ec 100644 --- a/plugins/links.rb +++ b/plugins/links.rb @@ -1,4 +1,5 @@ # encoding: UTF-8 +require 'addressable/uri' require 'uri' class Links < Linkbot::Plugin @@ -31,7 +32,7 @@ def on_message(message, matches) # So, split on the pipe and take the first thing until we get around to # chopping up that regex url = matches[0].split('|')[0] - url = URI.decode(url) + url = Addressable::URI.unescape(url) uri = URI.parse(url) # First, make sure this is a HTTP or HTTPS scheme diff --git a/plugins/urban.rb b/plugins/urban.rb index 15146c5..dfa3fdc 100644 --- a/plugins/urban.rb +++ b/plugins/urban.rb @@ -11,7 +11,7 @@ def on_message(message, match) word = Addressable::URI.escape(match[0]) doc = JSON.parse(http_get("http://www.urbandictionary.com/iphone/search/define?term=#{word}")) if doc["result_type"] == "exact" - "\"#{URI.decode(word)}\": " + doc["list"][0]["definition"] + "\n" + "Example usage: " + doc["list"][0]["example"] + "\"#{Addressable::URI.unescape(word)}\": " + doc["list"][0]["definition"] + "\n" + "Example usage: " + doc["list"][0]["example"] else "No match!" end