This projects helps me automate my pinterest pin creation. I can schedule the pins in the this schudule file and when running the application the schedule will be read and if a pin is up for creation, it will be created.
The project uses the Pinterest API v5 as well as the quickstart guide as reference.
To setup the project you first need prepare the config.yaml
and schedule.csv
files, as well as set the APP_ID
and APP_SECRET
environment variables.
Execute the following commend to prepare your config.yaml file.
mv config.yaml.example config.yaml
Next fill in the configuration with your data:
access_token_path: .access_token
schedule_file_path: /path/to/schedule.csv
browser_path: /path/to/a/browser/application
redirect_port: your_redirect_port
The redirect port must be the same that you set during your Pinterest Application setup
Same as for your config file, you need to execute this command to prepare your schedule file.
mv schedule.csv.example schedule.csv
The schedule file has the following structure:
created;timestamp;board;title;description;filePath;link
created
: boolean flag - always fill in falsetimestamp
: pin creation timestamp in the format 'Mon, 02 Jan 2006 15:04:05 MST'board
: name of the pinterest boardtitle
: title for the pindescription
: description for the pinfilePath
: path to the image file for the pinlink
: link to the external URL of the pin
In order to create an access token you need to provide your app ID and app secret as environment variables.
export APP_ID=<your app id>
export APP_SECRET=<your app secret>
While running the application you need to provide the config.yaml
file as an argument.
go run main.go config.yaml
go build -o ./bin/pin-creator