Skip to content

dpshelio/gmail-plotly

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gmail-plotly

A stupid gadget to plot the number of messages in your gmail inbox to plot.ly.

Setup instructions

  1. git clone https://github.com/tdsmith/gmail-plotly.git
  2. mkdir -p ~/.config/gmail-plotly (or change CONFIG_DIR)
  3. Set up a project in the Google Developer's Console.
  4. In the APIs & auth section on the left, choose APIs, and switch on the Gmail API.
  5. In the sidebar on the left, select Credentials and expand the OAuth 2.0 Client ID section. Choose "desktop app" and download the client secret JSON that's generated to CONFIG_DIR/google_client_secret.json.
  6. Visit your plot.ly settings and copy-paste the API Key on the "Profile" tab into CONFIG_DIR/plotly_key.
  7. echo your_plotly_username > CONFIG_DIR/plotly_username
  8. If you would like to make your graph public so that you can embed it in webpages and other silliness, touch CONFIG_DIR/plotly_make_public.
  9. From the gmail-plotly root, virtualenv . and activate with . bin/activate
  10. pip install -r requirements.txt
  11. Set up your Google credentials by running ./gmail-plotly.py --noauth_local_webserver and following the directions. This will also add the first data point to your plot.ly graph. The URL will be printed at the end.
  12. Add gmail-plotly to your crontab by having it run run-external.sh, which takes care of setting up the virtualenv. Or just run gmail-plotly.py whenever you want to update. Note that it's chatty right now and you may want to pipe stdout to /dev/null.

And now you have one of these. You can embed them in other pages as an iframe.

If you want to generate images locally for hotlinking, you can do that with plotly.image.save_as, probably.

About

A stupid gadget to plot the number of messages in your gmail inbox to plot.ly.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published