Skip to content

Instantly share code, notes, and snippets.

@tommelo
Created September 10, 2017 22:59
Show Gist options
  • Save tommelo/5c63394dc151eadfdd5fe805326aedb2 to your computer and use it in GitHub Desktop.
Save tommelo/5c63394dc151eadfdd5fe805326aedb2 to your computer and use it in GitHub Desktop.
Simple Social Influencer Finder
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