From 74f55f2c72c260ab6791ea478642692c2eb373f0 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Fri, 14 Jul 2017 08:41:33 -0700 Subject: Add "Find on Google Groups" per bug #602636. Signed-off-by: Robin H. Johnson --- lib/helpers.rb | 9 +++++++++ views/message.erb | 1 + 2 files changed, 10 insertions(+) diff --git a/lib/helpers.rb b/lib/helpers.rb index 8e58417..1e79b12 100644 --- a/lib/helpers.rb +++ b/lib/helpers.rb @@ -2,6 +2,7 @@ require 'rinku' require 'erb' MARC_FIND = 'https://marc.info/?i='.freeze +GOOGLEGROUP_SEARCH = 'https://groups.google.com/forum/#!search/messageid$3A'.freeze helpers do def list_check @@ -85,4 +86,12 @@ helpers do new_msgid = local + ' () ' + host.gsub('.', ' ! ') MARC_FIND + ERB::Util.url_encode(new_msgid) end + + def msgid_to_googlegroup(msgid) + # We have to transform the msg-id first + # "m2nf4d$9uu$1@dont-email.me" + # search is 'messageid:"m2nf4d$9uu$1@dont-email.me"' + # https://groups.google.com/forum/#!search/messageid$3A%22m2nf4d$249uu$241@dont-email.me%22 + GOOGLEGROUP_SEARCH + ERB::Util.url_encode('"' + msgid + '"') + end end diff --git a/views/message.erb b/views/message.erb index f26445d..523bf25 100644 --- a/views/message.erb +++ b/views/message.erb @@ -83,5 +83,6 @@ Report Message -- cgit v1.2.3-65-gdbad