combine.fm/lib/services/youtube/freebase.js

16 lines
409 B
JavaScript
Raw Normal View History

2015-08-20 23:22:57 +01:00
import { parse } from 'url';
import querystring from 'querystring';
import request from 'superagent';
import 'superagent-bluebird-promise';
2015-08-20 23:22:57 +01:00
const credentials = {
key: process.env.YOUTUBE_KEY,
};
2015-08-20 23:22:57 +01:00
const apiRoot = "https://www.googleapis.com/freebase/v1/topic";
2015-08-20 23:22:57 +01:00
export function* get(topic) {
const result = yield request.get(apiRoot + topic + "?key=" + credentials.key).promise();
return result.body;
}