|
|
2010-08-28
, 21:17
|
|
Posts: 23 |
Thanked: 11 times |
Joined on Aug 2010
|
#2
|
// ==UserScript==
// @name Maemo Neue Beiträge
// @description Neue Beiträge werden per Knopfdruck in neuen Tabs ab dem letzten gelesenen Beitrag geöffnet
// @include http://talk.maemo.org/*
// ==/UserScript==
var strLabel;
var allLinks, thisLink, thisImg;
var i;
// LabelAll = "Öffne alle Threads in tabs";
LabelAllNew = "Öffne alle Threads mit neuen Posts in tabs";
// GM_registerMenuCommand(LabelAll, openAllPosts);
GM_registerMenuCommand(LabelAllNew, openAllNewPosts);
// Get insertion location
allLinks = document.evaluate(
"//td[contains(@class, 'thead')]",
document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null
);
// Insert link(s)
thisLink = allLinks.snapshotItem(16);
thisLink.innerHTML = thisLink.innerHTML + ' <a href="#" title="' + LabelAll + '"><img src= "http://talk.maemo.org/maemo/images/buttons/firstnew.gif" alt="' + LabelAll + '" title="' + LabelAll + '" border="0" /></a>';
thisLink.addEventListener('click', openAllNewPosts, true)
// Open links in new tabs
function openRecentPosts(maxLinks) {
if (maxLinks == 0) {
maxLinks = allLinks.snapshotLength;
}
for (var i = 0; i < allLinks.snapshotLength; i++) {
if (i == maxLinks) {
break;
}
thisLink = allLinks.snapshotItem(i);
GM_openInTab(thisLink.href);
}
}
// Wrapper functions, since GM_registerMenuCommand seemed unable
// to handle function arguments directly
function openAllNewPosts()
{
// LINKS TO RECENT POSTINGS
// Select links
allLinks = document.evaluate(
"//a[contains(@href, 'newpost')]",
document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null
);
openRecentPosts(0);
}
function openAllPosts()
{
// LINKS TO RECENT POSTINGS
// Select links
allLinks = document.evaluate(
"//a[contains(@href, '#post')]",
document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null
);
openRecentPosts(0);
}
| The Following User Says Thank You to Fedmahn Kassad For This Useful Post: | ||
|
|
2010-09-08
, 21:27
|
|
Posts: 23 |
Thanked: 11 times |
Joined on Aug 2010
|
#3
|
| The Following User Says Thank You to Fedmahn Kassad For This Useful Post: | ||
here is one of my daily routines on the n900:
1. opening talk.maemo.org in microb
2. clicking on active topics "more", opens last 25 updated threads
3. opening the last pages of threads i like in separate windows
i have no skills related to greasemonkey scripts, can someone
help out to automize the above or a similar procedure?
for instance opening the last pages of all 25 threads?
Blues