0

obtaining the value of a proxy in a joined YQL query

Hi - I'm using the following query to get the music page for an artist, and then scraping that page for the artist photo.

CODEBOX
select * from html where url in (select url from music.artist.search(1) where keyword="Yes") and xpath="//img[@id='artistArtistImg']"


The inner part of that query returns the URL for the page, which I want to leverage elsewhere in my code (select url from music.artist.search(1)...)

I'm using flash to extract the contents of the returned XML, and it looks like this:

CODEBOX
<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
yahoo:count="1" yahoo:created="2011-07-07T21:43:07Z" yahoo:lang="en-US">
<diagnostics>
<publiclyCallable>true</publiclyCallable>
<url execution-time="202"><![CDATA[http://us.music.yahooapis.com/artist/v1/list/search/artist/Yes?start=1&count=1]]></url>
<url execution-time="1761" proxy="DEFAULT"><![CDATA[http://new.music.yahoo.com/yes/]]></url>
<user-time>2095</user-time>
<service-time>1963</service-time>
<build-version>19262</build-version>
</diagnostics>
<results>
<img alt="Yes photo" id="artistArtistImg"
src="http://d.yimg.com/ec/image/v1/artist/268559;encoding=jpg;size=156x94" title="Yes photo"/>
</results>
</query>


if I attempt to grab anything from within the <results> node it works fine, but if I try to get anything from the diagnostics node, it doesn't work. What I'm after is that "http://new.music.yahoo.com/yes/" URL - is there an easier way to get this without running a separate query?

by
0 Replies

Recent Posts

in YQL