Stuff with the Perl Foundation. A couple of patches in the Perl core. A few CPAN modules. That about sums it up.
Just playing around. It's not overly useful, but it's nice to see it work (and it's fragile). Replace 'some_user_name' below to ignore the user of your choice. No, it doesn't have a lot of features, but it was fun to write
// ==UserScript==
// @name ignore.use.perl
// @namespace http://publius-ovidius.livejournal.com/
// @description Hide Annoying Users
// @include http://use.perl.org/*
// ==/UserScript==
(function() {
var user = 'some_user_name';
var href = '//use.perl.org/~'+user+'/';
// I want zero-width positive look ahead assertions in XPath. That
// would eliminate the awful parentNode.parentNode.parentNode;
// Does this feature exist and I just don't know it?
var divs = document.evaluate(
"//div[@class='full']/div/div[@class='details']/a[@href='"+href+"']",
document,
null,
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
null
);
for ( var i=0; i < divs.snapshotLength; i++ ) {
var node = divs.snapshotItem(i).parentNode.parentNode.parentNode;
node.innerHTML = '<p><strong>Ignoring '+user+' via GreaseMonkey</strong></p>';
}
})();
XPath has it (Score:1)
It's possible, but I'm not sure how to handle multiple predicates. For the simple case, it looks like this:
"div[/*/span[@class='storyicons']]"
which pulls out all the divs which have a grandchild which is a span with a class of 'storyicons'.
Re: (Score:1)
You can put multiple predicates on a single path step. Something like
/foo[@bar='baz'][@quux='qux']is completely valid (and logically equivalent to/foo[@bar='baz' and @quux='qux']).Re: (Score:1)
ah!
So in the example above, it would be something like
"//div[@class='full'][.//div/div[@class='details']/a[@href='"+href+"']]"
(I think)
Re: (Score:1)
Yes; or alternatively:
Re: (Score:1)
Err, wait, no. Where did that
.//in your second predicate come from? It would be eitheror
You want those nested DIVs and As as direct child nodes of each other and of the node in question – you’re not looking for that subtree anywhere further down.
Re: (Score:1)
Ah, okay -- I'm not that familiar with XPath yet.