Skip to content

Instantly share code, notes, and snippets.

@myndzi
Created November 22, 2014 18:04
Show Gist options
  • Save myndzi/4696fcbb985a74e81795 to your computer and use it in GitHub Desktop.
Save myndzi/4696fcbb985a74e81795 to your computer and use it in GitHub Desktop.
'use strict';
var Rx = require('rx'),
PassThrough = require('stream').PassThrough;
var helpers = require('./helpers');
var pt = new PassThrough();
var select = require('./rx-select');
var foo = select(':nth-child(2) a:not([keke=lar])', pt);
foo.subscribe(function (r) {
console.log(r);
});
pt.write(
'<HTML><BODY><DIV>'+
'<ul>'+
'<li><a href="one">one</a></li>'+
'<li><a keke="baz" href="two">two</a></li>'+
'<li><a h'
);
pt.write('ref="three">three</a></li>'+
'</ul>'+
'<ul>'+
'<li><a href="four">four</a></li>'+
'<li><a keke="lar" href="five">five</a></li>'+
'<li><a href="six">six</a></li>'+
'</ul>'+
'</DIV></BODY></HTML>'
);
pt = new PassThrough();
foo = select(':nth-child(2) a:not([keke=lar])', pt);
foo.subscribe(function (r) {
console.log(r);
});
pt.write(
'<HTML><BODY><DIV>'+
'<ul>'+
'<li><a href="one">one</a></li>'+
'<li><a keke="baz" href="two">two</a></li>'+
'<li><a h'
);
pt.write('ref="three">three</a></li>'+
'</ul>'+
'<ul>'+
'<li><a href="four">four</a></li>'+
'<li><a keke="lar" href="five">five</a></li>'+
'<li><a href="six">six</a></li>'+
'</ul>'+
'</DIV></BODY></HTML>'
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment