Skip to content

Build a travel website to discover the most popular cities and photo spots for tourists, by scraping travel-related data on Instagram.

Notifications You must be signed in to change notification settings

ashleycheng/InsTrip

Repository files navigation

InsTrip

This project built a travel website called InsTrip , which makes users to explore the most popular travel cities and photo spots on Instagram. To analyze Instagram data, this project created web scrapers to extract Instagram posts with travel-related hashtags and check-in data. It also used ChatGPT to provide travel destination introductions based on data analysis charts.

Tech stack

image

Data model

image

Get started

1. Set up environment

Create .env file to set environment variables needed in this project.

DB_USER=YOUR_DB_USER_NAME 
DB_PASSWORD=YOUR_DB_PASSWORD 
DB_HOST=YOUR_DB_HOST
DB_PORT=YOUR_DB_PORT 
DB_NAME=YOUR_DB_NAME 
API_TOKEN=YOUR_API_TOKEN 
IG_ACCOUNT=YOUR_IG_ACCOUNT 
IG_PASSWORD=YOUR_IG_PASSWORD

2. Launch the web app using Docker

Run docker-compose.yml to create the docker container for the Django web application.

docker-compose -f docker-compose.yml build
docker-compose -f docker-compose.yml up

Run the web scrapers to get public data on Instagram

Here are two web scrapers that can be executed through any scheduling tool.

$ python web_scraper/ig_post_scraper.py [country name]
$ python web_scraper/ig_location_scraper.py

API document

Endpoint

  • api/top/city/{country}: get the ranking of the most popular cities among tourists on Instagram
  • api/city/{city}/info: get the city information
  • api/top/location/{city}: get the ranking of the most popular photo attractions (group by the category of attractions)
image image image

About

Build a travel website to discover the most popular cities and photo spots for tourists, by scraping travel-related data on Instagram.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published