Last active
June 19, 2017 23:39
-
-
Save dance2die/e1f033ab2a6180929cdeb71e8da5f00b to your computer and use it in GitHub Desktop.
YqlAjax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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