Skip to content

Instantly share code, notes, and snippets.

@EsteveSegura
Created September 28, 2019 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EsteveSegura/395e27432c4bfbb83bcdacafbabb57a7 to your computer and use it in GitHub Desktop.
Save EsteveSegura/395e27432c4bfbb83bcdacafbabb57a7 to your computer and use it in GitHub Desktop.
//we create a function to get all the hashtags we want
async function getPostsFromHashtags(ig,arrayOfHashtags){
//Create an empty array to store all hashtags
let allPosts = []
//We go through the entire list of hashtags and add it to our empty array
for(let i = 0 ; i < arrayOfHashtags.length ; i++){
let hashtagActual = await recentHashtagList(ig,arrayOfHashtags[i])
allPosts.push(hashtagActual)
}
//This line of code aligns all the elements in the same array
return [].concat.apply([], allPosts)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment