mumuplayer search
![]() |
Hey man. First of, awesome script. Second, I was wondering if you could edit the script and take out the search part and make it work with mumuplayer links. So far I got this:
// Search feature - finds all last.fm threads
if ( String(window.location).match("mu/") && ! String(window.location).match("mu/res") ) {
var replyArea = document.getElementsByTagName("form")[1];
if (!scriptUser) {
replyArea = document.getElementsByTagName("form")[2];
}
var searchbox = document.createElement('div');
searchbox.setAttribute('align', 'center');
var searchbutton = document.createElement('button');
var regexp = /mumuplayer.com/;
var threadrx = /\[<a href="res\/(\d+)">Reply<\/a>\]/;
searchbutton.textContent = "Search for Mumuplayer threads";
searchbox.appendChild(searchbutton);
replyArea.parentNode.insertBefore(searchbox, replyArea);
replyArea.parentNode.insertBefore(document.createElement('hr'), replyArea);
searchbutton.addEventListener('click', ( function() {
var d = new Date();
var t = d.getTime(); //used to force un-cached page
var pagesremain = 10;
for ( var i=0 ; i <= 10; i++ ) {
var page = i;
if (i == 0) {
page = '';
}
searchbox.innerHTML = "<b>Mumuplayer threads:</b>";
GM_xmlhttpRequest({
method: 'GET',
url: "http://boards.4chan.org/mu/" + page + "?t=" + t,
headers: {
// 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
'Accept': 'text/html,application/atom+xml,application/xml,text/xml',
},
onload: function(response) {
// search each page
if ( regexp.test(response.responseText) ) {
// search each thread
var threads = response.responseText.split('<span class="postername">');
for ( var i=1 ; i <= threads.length; i++ ) {
if ( regexp.test(threads[i]) ) {
var lastfmthread = threads[i].match(threadrx)[1];
// gm_log( lastfmthread );
searchbox.innerHTML += '<br><a href="res/' + lastfmthread + '" class="quotelink">>>' + lastfmthread + '</a>';
}
}
} else {
pagesremain--;
if (pagesremain < 0) {
searchbox.innerHTML = "<b>No Mumuplayer threads found!</b>";
}
}
}
});
}
} ), false);
}
As you can see, I simply switched the link and text.
|
![]() |
I tested what you posted and it should work just fine. Is it not working for you? Make sure that there is a mumuplayer link for it to find. |
![]() |
Well at first I was thinking about having a new extension just for searching mumuplayer links.
|
![]() |
Okay, I'm working on some changes to the script and will have a new version uploaded soon. I made it so that there are two search buttons, one for last.fm and one for mumu. I just want to test it a bit first but last.fm's site seems to be having problems at the moment. |
![]() |
Script has been updated, it now has a MuMu Player search button. |
![]() |
Great! Thanks a lot, very much appreciated. |

