Reply
Thread Tools
BluesLee's Avatar
Posts: 411 | Thanked: 1,105 times | Joined on Jan 2010 @ Europe
#1
hello,

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
 
Posts: 23 | Thanked: 11 times | Joined on Aug 2010
#2
Hi,
we talked about that.
Here is my script for Greasemonkey on desktop Firefox.
Just open paste it in editor and save as "maemo-talk-newpost.user.js"
Then open it in Firefox with the File-> Open dialogue.
Then Greasemonkey should install.
When you are on talk.maemo.org Greasemonkey will be available and you will have the option "Öffne alle Threads in tabs". This will open all new posts from the first unread in a new tab.
It is very basic and needs to be localized since it is in german "Denglish". But maybe it is a starting point for enhancement. I havent testet it on N900.
Here we go:
Code:
// ==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 + '&nbsp;<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:
Posts: 23 | Thanked: 11 times | Joined on Aug 2010
#3
Ok., found the problem and a workaround. It is the theme. The script always first goes to the active topics. The script will work fine, if you change the theme to classical in your view settings.
 

The Following User Says Thank You to Fedmahn Kassad For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 08:11.