Created
September 10, 2017 22:59
-
-
Save tommelo/5c63394dc151eadfdd5fe805326aedb2 to your computer and use it in GitHub Desktop.
Simple Social Influencer Finder
This file contains hidden or 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 Google = require('./lib/google'); | |
var Hunter = require('./lib/hunter'); | |
var Instagram = require('./lib/instagram'); | |
/** | |
* The defaul constructor | |
*/ | |
function Influence() { | |
} | |
/** | |
* Searches instagram profiles based on the given term | |
* | |
* @param {String} term The term to search | |
* @param {Number} limit The google's search limit | |
* @return {Promise} promise A promise to be executed | |
*/ | |
Influence.find = function(term, limit) { | |
var google = new Google(); | |
return google.search(term, limit) | |
.then(function(links) { | |
var hunter = new Hunter(); | |
return hunter.hunt(links); | |
}) | |
.then(function(profiles) { | |
var instagram = new Instagram(); | |
return instagram.profiles(profiles); | |
}); | |
} | |
module.exports = { | |
Google: Google, | |
Hunter: Hunter, | |
Instagram: Instagram, | |
Influence: Influence | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment