SoPR / maria-tech-brigade-effort

This repository is a place to place ideas and communication records in an effort to keep everything open and accesible.
MIT License
37 stars 1 forks source link

Automate raw data collection from received emails #14

Open karmacelina opened 7 years ago

karmacelina commented 7 years ago

1) We need a way to automatically send people a "Recibido" email after we open up the emails they send to mariatechbrigade@gmail.com.

2) We need to automate the ingestion of the photos they send -- files have names like IMG_####.jpg and they need to become: dateMMDDYY_town_photonumber.jpg and go to the LISTAS folder in PARA_VOLUNTARIOS in Google Drive for mariatechbrigade@gmail.com

If I am missing a straightforward way of doing this, please let me know.

oldmud0 commented 7 years ago

You can use a time-driven Google Apps Script.

  1. A regular filter labels incoming messages to Unprocessed.
  2. Every 10 minutes or so, the script goes through the emails labeled as such.
  3. For each email, the script checks whether or not has at least one .jpg attachment.
  4. For each attachment, the script should check the EXIF info for date and geotagging. If there is a geotag, the coordinates should be looked up to find the town. Each attachment is then moved to Google Drive. (The problem here is what happens if the town is only specified in the body of the email - then you'd require manual processing. So, this part of the script might be a little problematic to code.)
  5. On success, a "Recibido" email is sent back, and the incoming email is re-labeled as Processed.
  6. On failure, the incoming email is labeled Invalid or Needs manual processing.
karmacelina commented 7 years ago

Ok. Any chance someone can implement this now? Will be away until 13.30 EST

karmacelina commented 7 years ago

i'll try to implement this tomorrow while at work -- may ask coworkers for help during lunch break. also, most emails are coming through with text and not photos. tomorrow this might change. i spoke on air at radio isla 1320AM radio at approx. 6:30 PM EST and got some emails. i will try to get on air again tomorrow earlier to get the message out during suitable morning hours.

andygimma commented 7 years ago

I'd like to lend a hand if I can. I've worked with some Google Scripts before. With spreadsheets, rather than email, but I'm comfortable with the fundamentals.