Skip to content

iakovleva/vu_yandex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VU_Income

Regularly collects data from Yandex Direct. Stores this data in Google Spreadsheet.

Prerequisites

Script uses:

  • Yandex Direct API
  • Gspread for authorization in Google SpreadSheets

Getting Started

  1. Create Google SpreadSheet

  2. In SpreadSheet:

    • Create 2 tabs called 'hourly', 'daily'.
    • Add headers in the first row: 'Date/Time', '', '', 'Google', 'Yandex'
    • In the first column of 'daily' tab write yesterday's date, i.e. '08.01.18'
    • In the first column of 'hourly' tab write today's date and time, i.e. '09.01 12:00'
  3. Create project

git clone https://github.com/iakovleva/vu_yandex
cd vu_yandex
  1. Get Google API credentials for Gspread authorize. Follow https://gspread.readthedocs.io/en/latest/oauth2.html Save JSON file with credentials in the current directory.

  2. Add env variables to .env file

CRED_FILE - JSON file with Google API credentials TOKEN - Yandex OAuth-токен пользователя SPREADSHEET_INCOME - Google Spreadsheet URL

  1. Build image and run container
docker run --rm --env-file .env $(docker build -q .) hourly
docker run --rm --env-file .env $(docker build -q .) daily 

Detailed by regions:

docker run --rm --env-file .env $(docker build -q .) hourly regions
docker run --rm --env-file .env $(docker build -q .) daily regions
  1. Optionally add cron job
* * * * * /usr/bin/docker run --env-file .env vu_income:yandex hourly > ~/vu_yandex/hourly.log

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •