Getting info from URL into stack
Posted: Tue Sep 17, 2013 3:26 pm
I'm trying to get information from the Google Books API into a livecode stack. I've managed to get it into html format and if I go to this URL in a web browser I get exactly what I need (for example: put "http://kellymdeters.on-rev.com/readingt ... 0309217422"). However, when I try to get that info into my stack I keep getting the source, not the information as it would be viewed in a web browser.
I tried:
but that still doesn't work.
Any ideas?
Thanks!
(This is the code that is in that book.lc page)
I tried:
Code: Select all
put "http://kellymdeters.on-rev.com/readingtrackerapp/book.lc?isbn=9780309217422" into tURl
set the htmltext of field "field" to url tURL
Any ideas?
Thanks!
(This is the code that is in that book.lc page)
Code: Select all
<html>
<body>
<div id="content"></div>
<script>
function handleResponse(response) {
for (var i = 0; i < response.items.length; i++) {
var item = response.items[i];
document.getElementById("content").innerHTML += "<br>" + item.volumeInfo.title + "<br>" + item.volumeInfo.authors + "<br>" + item.volumeInfo.description + "<br>" + item.volumeInfo.pageCount + "<br>" + item.volumeInfo.imageLinks.smallThumbnail + "<br>" + item.volumeInfo.imageLinks.thumbnail;
}
}
</script>
<?lc
put $_get["ISBN"] into tISBN
put "<script src=" & quote & "https://www.googleapis.com/books/v1/volumes?q=isbn:" & tISBN & "&callback=handleResponse" & quote & "></script>"
?>
</body>
</html>