LoginSignup
11

More than 5 years have passed since last update.

google docsにコマンドでアップロードしたい!googleコマンドラインツール

Posted at

概要

Googleのサービスをコマンドラインから操作しよう!

  • 'picasa'
  • 'blogger'
  • 'youtube'
  • 'docs'
  • 'contacts'
  • 'calendar'
  • 'finance'

参考URL

公式

インストール

うまく動かないやーつ

うまく動かないやーつインストール

command
$ sudo pip install googlecl

google docs list
を実行すると、エラーが出ちゃう。

Traceback (most recent call last):
  File "/usr/local/bin/google", line 849, in <module>
    main()
  File "/usr/local/bin/google", line 835, in main
    run_once(options, args)
  File "/usr/local/bin/google", line 540, in run_once
    options.config)
  File "/usr/local/bin/google", line 373, in import_service
    service_module = import_at_runtime('googlecl.' + service + '.client')
  File "/usr/local/bin/google", line 332, in import_at_runtime
    return __import__(module, globals(), fromlist=['0'])
  File "/Library/Python/2.7/site-packages/googlecl/docs/client.py", line 47, in <module>
    googlecl.client.BaseClientCL):
  File "/Library/Python/2.7/site-packages/googlecl/docs/client.py", line 55, in DocsClientCL
    DOCLIST_FEED_URI = gdata.docs.client.DOCLIST_FEED_URI
AttributeError: 'module' object has no attribute 'DOCLIST_FEED_URI'

このURLに書いてある内容のエラーだった

うまく動かないやーつアンインストール

$ sudo pip uninstall googlecl

うまく動くやーつ

インストール

$ sudo pip install http://googlecl.googlecode.com/svn/trunk/
$ google docs list

Please specify user: (アカウント)

ブラウザが起動する

googlecl001.png


googlecl002.png

Please enter the verification code on the success page:(前の画面で表示されたやーつ)

操作

対話形式

$ google
> help
Welcome to the Google CL tool!
  Commands are broken into several parts: 
    service, task, options, and arguments.
  For example, in the command
      "> picasa post --title "My Cat Photos" photos/cats/*"
  the service is "picasa", the task is "post", the single
  option is a title of "My Cat Photos", and the argument is the 
  path to the photos.

  The available services are 
'help', 'picasa', 'blogger', 'youtube', 'docs', 'contacts', 'calendar', 'finance'
  Enter "> help <service>" for more information on a service.
  Or, just "quit" to quit.
> quit
$ 

docs upload

$ google docs upload work.txt 
Loading work.txt
Upload success! Direct link: https://docs.google.com/a/realworld.jp/document/d/xxxxxxxxxxx/edit?usp=docslist_api
$ 

問題点(google docs upload)

「-f FOLDER, --folder=FOLDER」が効かない。
参考

Also note that --folder is currently broken;

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11