Blog

Interact with Google Apps at the Command Line

18 Giu/10


Having a ball playing around with the just-released GoogleCL tool, which offers command line access to Google Calendar, contacts, Docs, Picasa, Blogger, and YouTube. With Python-based GoogleCL installed, you can do things such as list today’s events on your GCal right in the terminal, like so:

$ google calendar today title
Coffee with Michael and Samir
Dozing off
Lunch at Flingers

Instant use case: Add echo "Next 24 hours:";google calendar today title to your ~/.bash_profile file to see what you’ve got scheduled for the day when you launch a new Terminal window. Some more GoogleCL fun inside.

If you just type google at the command line, you launch an interactive terminal that lets you try all the various commands. In the interactive terminal, type command-name help to see its options, like help calendar.

Each command has several parameters that aren’t immediately apparent. For example, in calendar, you can omit the long and hairy event URL by using the title parameter. You can list events for a particular day using the data parameter (--date 2010-06-16), and you can get events from a particular calendar and by keyword search term.

For example, to see all my trips to NYC on my TripIt calendar, I’d use the command:

$ google calendar list --cal TripIt --query NYC

Remember the beauty of the command line: you can easily chain commands together with the pipe, so you can sed, awk, and grep output to your heart’s content, and then write it to a file if needed, using >. Before I discovered the title parameter on the calendar command, I was planning to use sed to filter out the calendar URLs from the output. (Thanks to lightening-fast sed and awk experts on Twitter, I was prepared to do just that.)

What I’d love to do is create a Todo.txt CLI add-on that inserts an event on your Google Calendar when you add a task with a due date. Here’s the discussion about that going on now on the Todo.txt CLI mailing list. It’s pretty much a no-brainer.

While I’ve mostly only played with calendar, the Docs access is pretty useful, too. With it, you could easily schedule cron’ed backups of your Google Docs, or push data into a new doc on a regular basis. Same deal with Picasa and YouTube. I like the idea of cron’ing a job that backs up my Google contacts to a CSV file on my local computer weekly, too. I don’t see myself ever blogging from the command line, but it’s neat that you can.

How are you using GoogleCL? Post your favorite command combos in the comments.

Continua a leggere – Original Link: Interact with Google Apps at the Command Line

Technorati Tags: , , , , , , , , ,

Realizzazione Sito Gestionale Immobiliare

Leggi Anche

Condividi
Condividi in DeliciousCondividi in DiggCondividi in RedditCondividi in StumbleCondividi in MixxCondividi in TecnoratiCondividi in Ok Notizie

Commenti

I commenti sono disabilitati per questo articolo.

I commenti sono chiusi.

Autore

Archivio

Iscrizione Newsletter

    Tieniti informato con tutte le novità del mondo informatico con la nostra newsletter
    Email:

    Nome:

    Auto Shop Italia
    Web Burning Blog
    Info Privacy

Meta