mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05: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:
parent
fe2cf2e270
commit
4206716d2a
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user