Finally finished giant ES6 refactor
This commit is contained in:
parent
c6d48cc424
commit
03e2666958
39 changed files with 553 additions and 635 deletions
|
@ -1,20 +1,15 @@
|
|||
"use strict";
|
||||
var parse = require('url').parse;
|
||||
var Promise = require('bluebird');
|
||||
var request = require('superagent');
|
||||
require('superagent-bluebird-promise');
|
||||
import { parse } from 'url';
|
||||
import querystring from 'querystring';
|
||||
import request from 'superagent';
|
||||
import 'superagent-bluebird-promise';
|
||||
|
||||
var credentials = {
|
||||
const credentials = {
|
||||
key: process.env.YOUTUBE_KEY,
|
||||
};
|
||||
|
||||
var apiRoot = "https://www.googleapis.com/freebase/v1/topic";
|
||||
const apiRoot = "https://www.googleapis.com/freebase/v1/topic";
|
||||
|
||||
module.exports.get = function(topic) {
|
||||
return request.get(apiRoot + topic + "?key=" + credentials.key).promise().then(function(res) {
|
||||
return res.body;
|
||||
})
|
||||
export function* get(topic) {
|
||||
const result = yield request.get(apiRoot + topic + "?key=" + credentials.key).promise();
|
||||
return result.body;
|
||||
}
|
||||
|
||||
|
||||
module.exports.get("/m/0dwcrm_");
|
Loading…
Add table
Add a link
Reference in a new issue