Skip to content

Instantly share code, notes, and snippets.

@dance2die
Last active June 19, 2017 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/e1f033ab2a6180929cdeb71e8da5f00b to your computer and use it in GitHub Desktop.
Save dance2die/e1f033ab2a6180929cdeb71e8da5f00b to your computer and use it in GitHub Desktop.
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