Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Interact with OpenKeyval via YQL
###
Putting trust in Yahoo rather than OpenKeyval.
Probably not useful, just did it to see if it was possible.
###
okvGet = (key, callback) ->
yql_query = "select * from html where url='https://secure.openkeyval.org/#{key}' and xpath='/html/body/p/text()'"
$.ajax
url: 'https://query.yahooapis.com/v1/public/yql',
data:
q: yql_query,
format: 'json'
dataType: 'jsonp',
success: callback
okvPost = (data, callback) ->
postData = $.param(data)
yql_query = "select * from htmlpost where url='https://secure.openkeyval.org/' and postdata='#{postData}' and xpath='/html/body/p/text()'"
$.ajax
url: 'https://query.yahooapis.com/v1/public/yql',
data:
q: yql_query,
format: 'json',
env: 'store://datatables.org/alltableswithkeys'
dataType: 'jsonp',
if callback? then @.success = callback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment