- Get 20 most-liked posts for a location on Instagram
- Store fetched data in a json file
- Data stored includes the following: media code, date, comments count, likes count
- No access token needed (Uses instagram public api, not the official one)
- npm install
- Setup (view below)
- node crawler.js // start crawling
- node top20.js // list out top 20 most-liked posts
- To view the post, open the url 'https://www.instagram.com/p/MEDIA_CODE' (replace MEDIA_CODE with the media code for e.g. BdyyDF2lYdx)
Edit crawler.js
- Set the value of the variable 'location_id' to the Location ID
- Set the value of the variable 'max_id' to the maximum id (the highest id to start fetching posts from, data with a high id will be fetched first)
- node-json-db: ^0.7.3
- request: ^2.83.0