Get URL for Yahoo Query Language

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ivanw
Posts: 6
Joined: Sat Jun 23, 2007 9:10 am

Get URL for Yahoo Query Language

Post by ivanw » Tue Jan 25, 2011 2:47 am

I'm trying to retrieve the contents of this YQL query.

In my webbrowser it displays fine:
http://query.yahooapis.com/v1/public/yq ... xt%20in%20(select%20abstract%20from%20search.web(100)%20where%20query%20%3D%20'heart%20attack')%7Csort(field%3D'Result')%7Cunique(field%3D'Result')

Code: Select all

function getURL pURL
  set the httpHeaders to "Cache-control : no-cache"
  return URL pURL
end getURL

on mouseUp
   put "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20search.termextract%20where%20context%20in%20(select%20abstract%20from%20search.web(100)%20where%20query%20%3D%20'heart%20attack')%7Csort(field%3D'Result')%7Cunique(field%3D'Result')" \
          into tURL
   answer tURL
   put getURL(tURL) into tResults
   answer tResults
   answer libURLLastRHHeaders()
   
end mouseUp
However when calling in LiveCode, the results is blank

The header returned is "HTTP/1.1 400 Bad Request", but provides no other useful information to troubleshoot.

Could anyone please help me with suggestions to further troubleshoot why the URL is not returning the same data in LiveCode as my browser (Firefox)?


Thanks,
Ivan

Post Reply