Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
aniruddhay
Level 7

picasa API returning URL in single quotes

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.
0 Kudos
5 Replies
MarkRoddy
Level 7

Re: picasa API returning URL in single quotes

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.
0 Kudos
aniruddhay
Level 7

Re: picasa API returning URL in single quotes

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.
0 Kudos
MarkRoddy
Level 7

Re: picasa API returning URL in single quotes

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
0 Kudos
aniruddhay
Level 7

Re: picasa API returning URL in single quotes

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.
0 Kudos
Anonymous
Level 8

Re: picasa API returning URL in single quotes

"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.
0 Kudos