1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-25 01:05:37 +00:00

SMJS: gmane: search for newsgroup or mailing list if no search terms

If given only one word, guess whether it is a newsgroup or a mailing list
and search for it.
This commit is contained in:
Miciah Dashiel Butler Masters 2006-06-23 03:52:49 +00:00 committed by Miciah Dashiel Butler Masters
parent fe2cf2e270
commit 4206716d2a

View File

@ -85,7 +85,17 @@ function gmane (url)
var v = url.split(' ');
var group = v[0], words = v.slice(1).join(' ');
if (!words) return "";
if (!group) return base_url;
if (!words) {
if (group.match(/^gmane\./)) {
/* Looks like a newsgroup. */
return "http://dir.gmane.org/" + group;
} else {
/* Looks like a mailing list. */
return "http://gmane.org/find.php?list=" + group;
}
}
return "http://search.gmane.org/search.php?query=" + words
+ "&group=" + group;