YQL Sample, keys, and misc.
So the kitchen sink has a great example of using yql, but when I use the same code in my application (slightly modified to work properly with a sible tab) it provides a error with NSDomain…
Simply put, I cannot find any good documentation on using yql with Titanium, nor any examples that show where to enter in the keys that Yahoo provides. I cannot even find this in the kitchen sink example.
Does anyone has sample code illustrating a standalone yql app (not flickr related) that works in 1.0.0???
2 Answers
-
Hi Conrad, here is a very simple sample code using YQL to get some data from Yahoo! Meme:
// Including OAuth Secrets And set the OAuth Params var consumerKey = '######YOUR CONSUMER KEY COMES HERE ##########'; var sharedSecret = '####### YOUR SHARED SECRET COMES HERE #########'; Titanium.Yahoo.setOAuthParameters(consumerKey,sharedSecret); Titanium.Yahoo.yql('SELECT * from meme.info WHERE name="acarlos1000"',function(e) { try { Ti.API.info("Starting loop with YQL Query"); Ti.API.debug('Found YQL results data? ' + e.success); if (e.message) { Ti.API.error('Error Message: ' + e.message); } meme = e.data.meme; memeName = meme.name; memeUrl = meme.url; guid = meme.guid; memeTitle = meme.title; memeNumFollowers = meme.followers; memeAvatarUrl = meme.avatar_url; memeDescription = meme.description; //Debug Info with data coming from YQL query Titanium.API.info('Data from query on meme.info table'); Titanium.API.debug('Meme Description: ' + memeDescription); Titanium.API.debug('Meme Title: ' + memeTitle); Titanium.API.debug('Meme Avatar URL: ' + memeAvatarUrl); } catch(E) { Titanium.API.error("Error = " + E); } });
-
Outstanding!!! Now I just got a test working without the OAuth in the Simulator, is this required when doing device testing? If so, where do the limiting items come into play.
If not, I know Yahoo limits 5000/IP, does anyone have a good idea of how iPhones/Android Devices register IP's?
Thanks again for the reply, it truly helps a ton!