Inspired from here.
upload or download file from emacs buffer to google drive
1 2 3 4 5 6 7 8 9 10 |
(defvar gdocs-folder-id "0B3kOusyMeFLVRXZ3QnpOb2x2eVE" "location for storing org to gdocs exported files, use 'gdrive list -t <foldername>' to find the id") (defun gdoc-upload-buffer-to-gdrive () "Export current buffer to gdrive folder identified by gdocs-folder-id" (interactive) (shell-command (format "gdrive upload --parent %s %s" gdocs-folder-id buffer-file-name))) |
import and export between emacs and google drive with conversion
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
(defun gdoc-download-to-current-buffer (doc) "This function is used to import a googleDoc file from a folder identified by gdocs-folder-id into current buffer." (interactive (list (completing-read "Choose one: " (split-string (shell-command-to-string (format "gdrive list -q \"'%s' in parents\"" gdocs-folder-id)) "\n")))) (setq my_shell_output (substring (shell-command-to-string ;;export and convert googel docs to text file (format "gdrive export --mime text/plain %s" (car (split-string doc " ")))) 0 -1)) (insert-file-contents (replace-regexp-in-string "\'" "" (nth 1 (split-string my_shell_output " "))))) |
5
NOV
NOV
About the Author:
Beyond 8 hours - Computer, Sports, Family...