|
ExampleScripts
Example commands and tasks GoogleCL can do.
Featured Also see the Manual and the SystemRequirements. Note that (only) the first time you use each service, you'll need to grant authorization from a web browser. GoogleCL will do its best to figure out what you wanted without specific options being mentioned. In the descriptions that follow, any required options will be filled in by leftover command line arguments. For example, here is the description for the Blogger "tag" task: Requires: title AND tags Optional: blog So if you do not specify --title or --tags, either on the command line or with your configuration file, GoogleCL will read the first argument as the title, and the second as a comma-separated list of tags. That is, $ google blogger tag "My Post" "tag1, tag2, tag3" is equivalent to $ google blogger tag --title "My Post --tags "tag1, tag2, tag3" If you think something strange is going on, add the --verbose flag to the command, and you should see an output of what required fields were not specified with an option flag, and what the options were ultimately filled in with. Here's an example output from blogger list: missing_reqs: ['fields'] There are also instances, (usually when listing or deleting events) where you want to specify more than one value for an argument. These should be picked up from the command line arguments semi-intelligently. For example: $ google calendar today Breakfast Lunch Dinner will decide that you're looking for events with titles that start with "Breakfast", or "Lunch", or "Dinner". These examples use regular expressions (albeit very simple ones). GoogleCL will only accept expressions that work with the Python re package. Regular expressions are enabled by default, but you can disable them with the regex configuration option. See ConfigurationOptions. The following examples omit the leading $ google <service> BloggerNote: --blog is required the first time you run a blogger task, unless you only have one blog. If you have more than one blog and do not specify --blog, the blog that you entered the first time you ran GoogleCL will be used. deleteDelete posts. Requires: title Optional: blog
listList posts. Requires: fields AND delimiter Optional: blog, title, owner
postPost content to a blog. Requires: src Optional: blog, title, tags, draft
tagLabel/tag posts in a blog. Requires: title AND tags Optional: blog See the Manual for tag syntax
CalendarNote: if --cal is omitted, your primary/default calendar will be used. Note: For list and delete, your ENTIRE CALENDAR will be retrieved. This can take a while. Use --date to restrict date ranges, and --query to match text in the event title or description. See the Manual for how to use --date. addAdd events. Requires: src Optional: cal
deleteDelete events. Requires: (title OR query) Optional: date, cal
listList events. Requires: fields AND delimiter Optional: title, query, date, cal
todayList events going on today. Essentially shorthand for --date <today>,<tomorrow> with the list task. Requires: fields AND delimiter Optional: title, query, cal
ContactsNote: --title is required for most of these. If you are prompted to enter a title, just hitting enter is equivalent to and faster than specifying ".". addAdd contacts. Requires: src Note: src can be a name,email pair, or a file that contains one name,email pair per line.
add-groupsAdd contact group(s) Requires: title
deleteDelete contacts. Requires: title
delete-groupsDelete contact group. Requires: title
listList contacts. Requires: fields AND title AND delimiter
list-groupsList contact groups. Requires: title Note: Groups that begine with "System Group:" are the groups Gmail starts with.
DocsNote: --folder will take the name of any folder, even subfolders. deleteDelete documents. Requires: title Optional: folder
editEdit a document. Requires: title Optional: format, editor, folder Note: editing with Open Office will not work. See Issue 79 . Note: You must have python-gdata >= 1.3.0 to edit documents.
getDownload a document. Requires: (title OR folder) AND dest Optional: format Note: You must have python-gdata >= 1.3.0 to download documents.
listList documents. Requires: fields AND delimiter Optional: title, folder
uploadUpload a document. Requires: src Optional: title, folder, format Note: --folder will accept only one folder to upload into. If you have two or more folders with the same name, even subfolders, you will have to pick between them (hard to do when they have the same name). Note: Users with a Google Apps Premium account can use an additional option: --no-convert. This will let you upload arbitrary filetypes to Docs, like you can through the web interface. Unfortunately, this is not enabled for regular users.
PicasacreateCreate an album. Requires: title Optional: src, date, summary, tags Note: --tags will be applied to each photo being uploaded, not the album.
deleteDelete photos or albums. Requires: (title OR query) Note: --title will match on album names, --query on photo tags and captions. If --query is specified, the objects being deleted will be photos that match the query value that are also in the album that matches --title.
getDownload albums. Requires: title AND dest Optional: owner, format Note: --format applies to videos ONLY, and should be either mp4 or swf
listList photos. Requires: fields AND delimiter Optional: title, query, owner Note: --title still matches on album titles. This will list photos inside albums that match the title.
list-albumsList albums. Requires: fields AND delimiter Optional: title, owner
postPost photos or video to an album. Requires: title AND src Optional: tags, owner
tagTag photos. Requires: (title OR query) AND tags Optional: owner
YoutubeNote: You must log on with your Google account, but the --owner option will only accept YouTube usernames. Note: The devkey is provided for you. However, because of the nature of the key, it may become invalid in the future, and in that case you will have to supply your own. --devkey will also take the name of a file where the devkey is stored. deleteDelete videos. Requires: title AND devkey
listList videos by user. Requires: fields AND delimiter Optional: title, owner
postPost a video. Requires: src AND category AND devkey Optional: title, summary, tags Note: A list of legal values for category can be found in the Manual. If you don't really care what category your video gets uploaded to, set a default in your configuration file (see ConfigurationOptions).
tagAdd tags to a video and/or change its category. Requires: title AND (tags OR category) AND devkey
|
"make me a sandwich" "no" "sudo make me a sandwich" "okay"
any hopes for: google gmail send --to "fred666@gmail.com" --subject "hey fred" mailbody.txt ?
was kinda expecting ^ that one...
what about the basic google search <key words...> ?
How does one authenticate?
yubnub.com please add these
Please consider:
google voice call 800-555-1212
That would make the calling feature of google voice actually usable.
Here's a sample script in Win...
C:\>python C:\lib\googlecl-0.9.5\src\google docs list
It will write a config file in your home dir and ask you to authenticate via browser the first time
I'd be interested in adding bulk # of contacts via command line. any possibilities?
How about google I'm feeling lucky?
randyoh, why not just use a shell loop?
How can I get a valid list of fields for google contacts list?
How about:
>less .htpasswd | google blogger post
ZOMG, GMail plz!
Or >find / -type d -perm 777 | google blogger post --blog "My blog"
You would think, being google and all.... SEARCH ... might be one of the services they'd support.... Just sayin'
for "google mail ..." one can use sendmail
What about: Google chat somebody "hi from a script"?
please please make gmail CL options too. Something like pine or mutt
Add Google Talk, please! Would be great to blat out IMs, initiate a call or file xfer via CL.
For those requesting email support on googlecl, you may want to have a look at mutt + gmail imap ...
Would the gmail part kinda open them up to a possible relay problem?
@maciej.gajewski0
I second the request for a buzz CLI app like the ones Google already made. That would be totally awesome. I spend most of my day in the terminal and it really slows me down when I have to buzz something.
Probably not the right place for this, but does anyone have a link to the killer_robots.avi video from the youtube example?
Great stuff guys!
For GMail one can use mutt (Requires you to have mutt setup to check gmail). $ echo "This is the body of the message" | mutt -s "Hello Fred" fred@fred.com -a attachment.jpg
May I offer a feature request: Give us the ability to grab a backup of a stated month of content on google blogger. E.g. I should be able to say
to snarf a copy of my blog for October 2005. This lends itself to:
Great suggestion. Don't forget to add it to the issues page: http://code.google.com/p/googlecl/issues/list
At the end there you're supposed to see backquotes surrounding the "date" comand.
In home page http://code.google.com/p/googlecl/, for picasa example, "--album" has been mentioned instead of "--title". Detailed info: http://karuppuswamy.com/wordpress/2010/06/19/solving-google-error-no-such-option-album-error-by-googlecl/
very nice! :)
Love~
I use command line tools to search google or gmail. Very easy to add.
Please add support for Goo.gl url shortener
For Google Voice, there's already pygooglevoice.
I got google storage I hope googlecl will support to NFS mount this storage without going to a lot of kungfu tricks!
Gmail search with regex plz
I have not been able to get
to work together with the --format flag. Can someone provide an example?
Google tasks API would be great!
Wow. Thanks for all the feedback, everyone! But as Jason mentioned,
1) The Issue Tracker is the place to request features. We won't necessarily get to read all the wiki comments.
2) We don't plan on supporting anything that isn't included in the gdata-python-client. If there's something you'd love to see, but they don't have it, go bug them :)
Many of you might want to try ActiveWords? (www.activewords.com) with the Google add in (http://www.activewords.com/applications.html#web). This offers a "global command line" from the keyboard at any time in every context. Would love to figure out how to leverage googlecl with ActiveWords? to add even more functionality for Google search and services.
there are already plenty of ways to send an email from the command line and these can use gmail just fine. frankly I don't see any value in adding yet another mechanism, especially given that it would probably be used by spammers more than anyone with a legitimate need (the legit folks already use gmail with standard email tools, suppose so do spammers)
$ google define feature //for Google dictionary
google tasks NAME list | add | complete | [--details | --due-date ] DATA
I know that there is no api, but come on... it would be superb gtd
google notebook NAME list | add | del | [--details ] DATA
sync contacts with abook for mutt?
Very nice tool! Please add more examples on how to list and deal with shared calendars.
Example: I work off of 6 shared calendars, How do I list all events from all calendars?
Also every project I work on has its own calendar. I would really like to make a new project calendar using googleCL then script add-in my project events, dates, and major milestones.
Some additional examples on how to accomplish this with GoogleCL would really help.
Holy cr@p! This is very cool! Thank you Googlers.
Thanks for freeing me from the Picasa web interface that only allows to upload 5 photos at once (very annoying).
However, the three most important services remain unsupported: Google Finance, Google Search, and GMail.
I would like a way to access orkut via command line, any way to post in scrapbook, put and get photo albuns from orkut to my pc.
A few things things that I would love to see in the API is gmail and tasks. That would make googlecl super awesome cool.
But.... Where is a Google Search?
Google translate from command line will be nice too.
Guys thanks,
Google Search would be nice so we don't have to use crappy cli web browsers...
Very nice. Keep up the good work.
Very nice..!!
Brilliant... google search "pizza" |grep "Poppa Johns"| google voice dial |(some sed/awk stuff to grab phone number)| speex "I want a large meat lovers delivered to".$HOME
im trying it with Cygwin and getting this error:
$ google blogger post --tags "GoogleCL, awesome" --title "Test Post" "I'm posting from the command line" Traceback (most recent call last):
SyntaxError?: not well-formed (invalid token): line 8, column 47Thank's Google for this..! I love GoogleCL...
Hm, how can I delete a single picture with title "TEST.jpg" from album "ALBUM_NAME"?
How about listing email on the command line
$ google gmail list --search "from:dad advice"
Thank you for this interesting release!
--query can be only a tag at this moment?
Anyone get this working behind a proxy with authentication?
I set the following env vars:
...and this has some effect - I no longer get a timeout or "Proxy Authentication Required" message. However, I still get the following error:
Traceback (most recent call last): File "src/google", line 463, in <module> main() File "src/google", line 457, in main run_once(options, args) File "src/google", line 330, in run_once token_valid = client.IsTokenValid() File "/home/seed/Downloads/googlecl-0.9.7/src/googlecl/calendar/service.py", line 265, in is_token_valid return googlecl.service.BaseServiceCL.IsTokenValid(self, test_uri) File "/home/seed/Downloads/googlecl-0.9.7/src/googlecl/service.py", line 170, in is_token_valid self.Get(test_uri) File "/usr/lib/python2.6/site-packages/gdata/service.py", line 1092, in Get encoding=encoding, converter=converter) File "/usr/lib/python2.6/site-packages/gdata/service.py", line 1103, in Get 'reason': server_response.reason, 'body': result_body} gdata.service.RequestError: {'status': 401, 'body': '<HTML>\n<HEAD>\n<TITLE>Unknown authorization header</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Unknown authorization header</H1>\n<H2>Error 401</H2>\n</BODY>\n</HTML>\n', 'reason': 'Unknown authorization header'}Any ideas?
Fantastic
love to see the service available from GOOG
Thanx a lot with encouraging today's generation with new tech and open source both.
calendar delete --query "!Lime" --cal Soccer --date 2010-06-01,2010-12-01 # Delete all events without the text "Lime" in the calendar "Soccer" in the date range
Anyone else having trouble with stuff like this?
> calendar add "Sit on the crapper today 3pm" > calendar delete --title "Sit on the crapper today 3pm" No events found that match your options!
"sudo make me a sandwich" doesn't work for me.
Can anybody help me??????
XX
I am also unable to delete a calendar entry: google calendar add "Softpedia today at 10pm" google calendar delete --title "Softpedia" No events found that match your options!
AWESOME!!!! This works perfectly on the Nokia N900 internet tablet. I just installed with no troubles at all, and it works fine at the command line. Fantastic job on this everyone. Love it!
What About
If Google included a terminal emulator and a "man Google" page was included then i'd be using this but my terminal has problems connecting via this proxy settings. Love the idea though. bring on the
E-mail
#google gmail draft --subject Yeah_the_terminal_still_has_power
When I create an event in my calendar it doesn't adds the default reminders. Is there any way to make it add the reminders? Or at least create a custom reminder in the cl command.
Is there a way to upload any type of file to google docs with googlecl?
I'm here waiting for gmail.. please..
For the guy wanting to backup his blog ... wget -r --user-agent="Internet Explorer" http://ysgitdiary.blogspot.com/
This looks quite interesting, i do wonder though, using the 'google docs' part of it, is it possible to upload a document to google docs, then download the uploaded file as a PDF (all from the command line)?
I am another one hoping for the gmail. It would be nice to be able to have something to feed into conky so I have an idea of what unread messages I have in what folders...
To get your gmail contacts importable in Cone:
google contacts list name,name,email|perl -pne 's%^((?!N\/A)(.+?)),((?!N\/A)(.+?)),([a-z0-9\._-]+\@([a-z0-9][a-z0-9-]*[a-z0-9]\.)+([a-z]+\.)?([a-z]+))%${1}:${3} <${5}>%imx'|grep -oP '^((?!N\/A)(.+?)) <[a-z0-9\._-]+\@([a-z0-9][a-z0-9-]*[a-z0-9]\.)+([a-z]+\.)?([a-z]+)>' | sortgoogle notes add "epic note...."
SO... I have a small issue. My upload works... However I cannot seem to set sharing for the doc by the googlecli script. I wish for my coworkers/friends to be able to be granted access to the new document. google docs upload blah.csv
does google have a way to delete history one at a time as needed thanks roeloo
I just wanted to comment to make you keeping this project alive.
I love it.
;)
thank you very much for your work
using the calendar hooks & the charts API i've had serious motivation to get back into shape
A+ for googleCL A++ for google!
thanks yall
How to get a list of available blogs on my account?
this is programming or scripting?
Google contacts should also support phone numbers. Is this planned?
I LOVE googleCL!! :)
I have found these helpful: 1.)add to your login file:
date echo"Today's evnets:" google calendar today
Then when you open a shell you will get the date and a list of your day's events.
2.)also add an alias like:
alias gcal='google calendar add "$1"'
Then you can just type gcal and add your event (use quotes). Obviously, lots more like this could be done with other types too.
there is an error in Docs > delete command example, it doesn't work for me, instead following works fine: google docs delete --title "filename"
Is there a way how to import .ics file using this tool?
Thanks , and is there any plan for : 1 - send mail :) 2- Google reader
And how to exit google-cl and get back to the normal terminal?
Gmail task from the command line would be super win, k thx bi
I would love to see 'voice' functionality. DND, which phones to forward to, etc.