From 427bb7c4b891f74a8bb68bbd4e2a6252d0121b40 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 12 Jul 2014 18:15:56 +0000 Subject: [PATCH 1/4] unescape reddit titles --- modules/reddit/reddit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/reddit/reddit.js b/modules/reddit/reddit.js index e2f7196..537d82b 100644 --- a/modules/reddit/reddit.js +++ b/modules/reddit/reddit.js @@ -59,7 +59,7 @@ var reddit = function(dbot) { if(!err && posts.length > 0) { _.each(posts, function(post) { dbot.say(channel.server, channel.channel, dbot.t('about_post', { - 'title': post.title.trim(), + 'title': _.unescape(post.title.trim()), 'poster': post.author, 'subreddit': post.subreddit, 'comments': post.num_comments, From 18f7f64b47b8e9794adfb6cb57f8da579a387c76 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 12 Jul 2014 18:19:59 +0000 Subject: [PATCH 2/4] unescape reddit titles for all links --- modules/reddit/reddit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/reddit/reddit.js b/modules/reddit/reddit.js index 537d82b..33ad8f7 100644 --- a/modules/reddit/reddit.js +++ b/modules/reddit/reddit.js @@ -260,7 +260,7 @@ var reddit = function(dbot) { this.api.getPostInfo(matches[4], function(info) { if(info) { var infoString = dbot.t('about_post', { - 'title': info.title.trim(), + 'title': _.unescape(info.title.trim()), 'poster': info.author, 'subreddit': info.subreddit, 'comments': info.num_comments, @@ -297,7 +297,7 @@ var reddit = function(dbot) { this.api.getPostInfo(match[2], function(info) { if(info) { var infoString = dbot.t('about_post', { - 'title': info.title.trim(), + 'title': _.unescape(info.title.trim()), 'poster': info.author, 'subreddit': info.subreddit, 'comments': info.num_comments, From 60f9c5ef2961e333f72c115bac1b9d120a85c35d Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 14 Jul 2014 13:41:29 +0000 Subject: [PATCH 3/4] change youtube to yt --- modules/youtube/youtube.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/youtube/youtube.js b/modules/youtube/youtube.js index 2758257..b85a088 100644 --- a/modules/youtube/youtube.js +++ b/modules/youtube/youtube.js @@ -64,7 +64,7 @@ var youtube = function(dbot) { }; this.commands = { - '~youtube': function(event) { + '~yt': function(event) { this.api.search(event.input[1], function(body) { if(_.isObject(body) && _.has(body, 'feed') && _.has(body.feed, 'entry')) { event.reply(this.internalAPI.formatLink(body.feed.entry[0])); @@ -74,7 +74,7 @@ var youtube = function(dbot) { }.bind(this)); } }; - this.commands['~youtube'].regex = [/^youtube (.+)$/, 2]; + this.commands['~yt'].regex = [/^youtube (.+)$/, 2]; this.onLoad = function() { dbot.api.link.addHandler(this.name, this.LinkRegex, From c0e8a588ecd23ad4a54d373d5d7406643ecfe756 Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 14 Jul 2014 13:42:56 +0000 Subject: [PATCH 4/4] change youtube to yt --- modules/youtube/youtube.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/youtube/youtube.js b/modules/youtube/youtube.js index b85a088..4a53027 100644 --- a/modules/youtube/youtube.js +++ b/modules/youtube/youtube.js @@ -74,7 +74,7 @@ var youtube = function(dbot) { }.bind(this)); } }; - this.commands['~yt'].regex = [/^youtube (.+)$/, 2]; + this.commands['~yt'].regex = [/^yt (.+)$/, 2]; this.onLoad = function() { dbot.api.link.addHandler(this.name, this.LinkRegex,