knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(bottle)
library(seafile)
library(gmailr)

First connect your gmail account

gm_auth_configure(path = "credentials.json")

# Authenticate with the tokens in the copied cache
gm_auth(email = TRUE, cache = ".secret")

Then ping your seafile repos

seafile::ping()

Now upload attchment to seafile

get_messages_id() %>% 
  import_files_from_gmail(path = tempdir()) %>% 
  upload_to_seafile(repos_id_destination = get_repo_id(name = "Pauline"))

And know, remove email from email and put in inside seafile label

get_messages_id() %>%
  remove_from_inbox()


VincentGuyader/bottle documentation built on Sept. 30, 2019, 12:35 p.m.