diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2017-07-14 08:41:33 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2017-07-14 08:42:27 -0700 |
commit | 74f55f2c72c260ab6791ea478642692c2eb373f0 (patch) | |
tree | 51996651a15c0961942ec94f4cf9968a8f603cc8 /lib/helpers.rb | |
parent | Update copyright date - thanks to Thomas (whissi) for the bug report and patc... (diff) | |
download | frontend-74f55f2c72c260ab6791ea478642692c2eb373f0.tar.gz frontend-74f55f2c72c260ab6791ea478642692c2eb373f0.tar.bz2 frontend-74f55f2c72c260ab6791ea478642692c2eb373f0.zip |
Add "Find on Google Groups" per bug #602636.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'lib/helpers.rb')
-rw-r--r-- | lib/helpers.rb | 9 |
1 files changed, 9 insertions, 0 deletions
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 |