Skip to content

Instantly share code, notes, and snippets.

@dance2die

dance2die/yql_ajax.js

Last active Jun 19, 2017
Embed
What would you like to do?
YqlAjax
var axios = require('axios');
var apiConfig = require('../apikey.js');
export default class YqlAjax {
ajax(url) {
const yqlUrl = "http://query.yahooapis.com/v1/public/yql";
let goodReadsURL = `${url}?key=${apiConfig.goodreadsKey}&user_id=${apiConfig.goodreadsUserID}&page=1`;
let q = `select * from xml where url="${goodReadsURL}"`;
return axios.get(yqlUrl, {
params: {
q: q,
format: "json"
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.