So I've been working on a way to scrape the data from a page and display it (in roughly the same format as the source). I found YQL and I am finding it brilliant, except I can't figure out how to just display the whole output with nothing special (except the basic formatting)The YQL input code is: \[code\]select * from html where url="http://directory.vancouver.wsu.edu/anthropology" and xpath="//div[@id='facdir']"\[/code\]using that it returns the JSON: \[code\]http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fdirectory.vancouver.wsu.edu%2Fanthropology%22%20and%20xpath%3D%22%2F%2Fdiv%5B%40id%3D'facdir'%5D%22&format=json&callback=anthropology\[/code\]I've followed the yahoo tutorials, and created the news widget among other things, but not one tutorial covered the basic view (don't need the links either, just the paragraph setup).
Like this:\[quote\] Name
Title
Phone###)###-####
Location: Building and Room #
[email protected]
\[/quote\]Here is what I had for output from http://christianheilmann.com, but it doesn't do anything (apparently none of her tutorials work, tried every one):\[code\]<html><head><script src="http://code.jquery.com/jquery-latest.js"></script> </head><body><p><b>Copied:</b></p><div><script>function anthropology (0) {// get the DIV with the ID $var info = document.getElementById('facdir');// add a class for stylinginfo.className = 'js';// if it existsif(info){// get the info data returned from YQLvar data = http://stackoverflow.com/questions/14048943/o.query.results.span;var link = info.getElementsByTagName('a')[0];link.innerHTML = '(see all info)';// to the main container DIVvar out = document.createElement('span');out.className = 'info';info.insertBefore(out,link.parentNode);}}</script><script src='http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fdirectory.vancouver.wsu.edu%2Fanthropology%22%20and%20xpath%3D%22%2F%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%22&format=json&callback=anthropology'></script></div>\[/code\]
Like this:\[quote\] Name
Title
Phone###)###-####
Location: Building and Room #
[email protected]
\[/quote\]Here is what I had for output from http://christianheilmann.com, but it doesn't do anything (apparently none of her tutorials work, tried every one):\[code\]<html><head><script src="http://code.jquery.com/jquery-latest.js"></script> </head><body><p><b>Copied:</b></p><div><script>function anthropology (0) {// get the DIV with the ID $var info = document.getElementById('facdir');// add a class for stylinginfo.className = 'js';// if it existsif(info){// get the info data returned from YQLvar data = http://stackoverflow.com/questions/14048943/o.query.results.span;var link = info.getElementsByTagName('a')[0];link.innerHTML = '(see all info)';// to the main container DIVvar out = document.createElement('span');out.className = 'info';info.insertBefore(out,link.parentNode);}}</script><script src='http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20html%20where%20url%3D%22http%3A%2F%2Fdirectory.vancouver.wsu.edu%2Fanthropology%22%20and%20xpath%3D%22%2F%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%2Fdiv%22&format=json&callback=anthropology'></script></div>\[/code\]