Your Digital Media Has Never Looked So Good

 
aniruddhay
Topic Author
Posts: 3
Joined: Fri May 28, 2010 3:12 am

picasa API returning URL in single quotes

Fri May 28, 2010 3:18 am

Hello,

I am fairly new to ROKU development and have been trying some stuff with feeds. I used the 'DeviantArt' example and was trying to access the Picasa API. THe problem is that the picasa feed gives the urls in single quotes. Using it within the existing 'DeviantArt' code, it is causing syntax error as the variable url is expecting the value in double quots. IS there any thing I can do to work around this? Thanks in advance.

url = photo.GetURL()

photo.GetURL() returns the single quote enclosed urls form the feed.
 
MarkRoddy
Posts: 36
Joined: Sat Jan 30, 2010 3:11 pm
Contact:

Re: picasa API returning URL in single quotes

Fri May 28, 2010 2:05 pm

I'm a little confused by what you mean by "gives urls in single quotes" so sorry if I'm not interpreting the question correctly.

If there's a quote in the URL itself you can use the Chr() function with the ascii character for a single quote and append it to the string.
 
aniruddhay
Topic Author
Posts: 3
Joined: Fri May 28, 2010 3:12 am

Re: picasa API returning URL in single quotes

Sun May 30, 2010 8:10 am

Hello MarkRoddy,

Thank you for posting a reply. What I mean is that when I parse the feed form Picasa, it gives me the url as 'www.example.com/somehting/xxxx.jpg', whereas in the code, when given a value for the variable, it expects, "www.example.com/somehting/xxxx.jpg". As it is getting a value with single quote, it is treating it as a syntax error. Is my understanding of the code correct? If it is, how do I convert the " to ' so the variable will take the value within the double quotes.

Sorry for being unclear on my first post.
 
MarkRoddy
Posts: 36
Joined: Sat Jan 30, 2010 3:11 pm
Contact:

Re: picasa API returning URL in single quotes

Tue Jun 01, 2010 9:30 am

Unless the quotes are required as part of the URL being requested:
http://foobar.com/something.php?item="foo"

This isn't an issue. The quotes a syntactic marker to say "this information is a string". In brightscript a double quote is the string marker and the single quote signifies a source code comment which is probably why you're getting the syntax error. If all you're trying to do is hard code a url into the source file, all you should have to do is use the double quotes. So change:
'www.example.com/somehting/xxxx.jpg'

To:
"www.example.com/somehting/xxxx.jpg"

And you should not have the syntax errors anymore.

-Mark
 
aniruddhay
Topic Author
Posts: 3
Joined: Fri May 28, 2010 3:12 am

Re: picasa API returning URL in single quotes

Tue Jun 01, 2010 9:39 am

Hello MarkRoddy,

Thank you again for replying to my post. I cannot hardcode the url in double quotes as I am pulling the urls from the picasa feed. Is there a way to replace the single quote ' to double quotes '' so that the code will not treat it as a comment or a malformed value?

thanks again.
 
RokuPatrick

Re: picasa API returning URL in single quotes

Tue Jun 01, 2010 10:04 am

aniruddhay wrote:
Hello MarkRoddy,

Thank you again for replying to my post. I cannot hardcode the url in double quotes as I am pulling the urls from the picasa feed. Is there a way to replace the single quote ' to double quotes '' so that the code will not treat it as a comment or a malformed value?

thanks again.



The new SDK will have perl-compatible regular expressions, which should make these replacement operations easier to perform.

Who is online

Users browsing this forum: No registered users and 6 guests