- Create and enable virtual environment
python3 -m venv .env; source .env/bin/activate
- Install python requirements
pip3 install -r requirements.txt
- Run application, using local sqlite database
DB_TYPE=sqlite3 python3 app.py
PYTHONPATH=./env/lib python3 tests/main.py
- Download Cloud Sql Proxy
wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy
- Make it executable
chmod +x cloud_sql_proxy
- Create a root cloudsql dir
sudo mkdir /cloudsql
- Start the Cloud SQL Proxy
sudo ./cloud_sql_proxy -dir=/cloudsql -instances=$PROJECT:us-central1:instapuller
- Setup the Env variables that let us connect to our Cloud SQL DB
export DB_USER='root'; export DB_PASS=$DB_PASS ; export DB_NAME='instapuller-staging' ; export CLOUD_SQL_CONNECTION_NAME='serverless-ux-playground:us-central1:instapuller'
- Make sure you're in the insta-puller directory
cd repos/instapuller/
- Enable the virtual environment
source .env/bin/activate
- Run the app
python app.py
- Download and store the associated media from posts.
- Build an API to query for stored information (perhaps using the API Gateway)
- What usernames are being tracked?
- How many posts are stored?
- Return the data for a username (with time searches)
- Maybe some unit-tests for code
- Automated recurring pulls for usernames in the database (Cloud Scheduler calls a Cloud Function)
- There are 2 cloud functions
- "Instapuller-nightly-updater" every 2 hours Hits the usernames endpoint and the requests a new pull for each username. Triggered by Cloud Scheduler
- "instapuller-media-download" pub/sub triggered cloud function on each successful DB insert for a new post. Stores the associated media in a Cloud Storage bucket.
Direct post page https://www.instagram.com/p/B82Cy69nDaQ/ Example User page https://www.instagram.com/danaherjohn