View this code at http://livecoding.io/3996090
View this code at http://livecoding.io/4608060
View this code at http://livecoding.io/4608246
View this code at http://livecoding.io/4608772
View this code at http://livecoding.io/4730608
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(XML) | |
getMARCField = function(marc_doc, tag, code) { | |
xpath = paste("/m:collection/m:record/m:datafield[@tag='", tag, "']/m:subfield[@code='", code, "']", sep="") | |
return(xpathApply(marc_doc, xpath, namespaces=c("m"), xmlValue)) | |
} | |
vs = xmlRoot(xmlParse('vail-first-3500.xml')) | |
field100a = getMARCField(vs, '100', 'a') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var httpAgent = require('http-agent'), | |
util = require('util'); | |
var agent = httpAgent.create('www.google.com', ['finance', 'news', 'images']); | |
agent.addListener('next', function (err, agent) { | |
console.log('Body of the current page: ' + agent.body); | |
console.log('Response we saw for this page: ' + util.inspect(agent.response)); | |
// Go to the next page in the sequence |