Tuesday, December 29, 2020

importing emails into google groups

Sending invites to a large number of email ids from google groups, found the following. 

  • The "500 per day" limit seems to include those email ids which were selected for sending, and then were not sent since they were already members of the group.
  • So, sending invites one by one - only one email at a time - would result in the maximum invites sent per day. But - this is very time consuming. Even with an automated script made with SikuliX, approximately 15 seconds per email id if processing one email at a time. 
  • Filtering out existing users makes the process much smoother. Script for that shared below. But the list still needs manual filtering of typos like gamil.com or gmailcom or gmail com etc. 
For comparing this list with the list of subscribers made earlier, the technique discussed here was modified to make the formula
=IF(ISERROR(MATCH(A143,Sheet2!B142:B,0)),"",A143)
That is, the existing users were copied into a sheet called Sheet2 on the same Google spreadsheet. This was further improved using the technique of ARRAYFORMULA discussed here, so that the entire column of thousands of cells were populated with one click. That is, enter the formula in the first cell, and instead of specifying just A2, mention the entire column in the form A2:A, and hit Ctrl+Shift+Enter after entering the formula.

Then a modified SikuliX script was used to do the import 10 emails at a time, which I've copy-pasted below. Captcha is not required for 10 emails or less. Alt+Shift+C is the key combination to abort the SikuliX script.

from time import sleep

sleeptime=0.5
lastlineofsheet=Location(412,656)
#Addbutton=Location(1068,286) changed to 75 percent below
Addbutton=Location(982,202)
#DirectAddToggle=Location(840,670) changed to 75 percent below
DirectAddToggle=Location(895,580)
#MembersToAddBox=Location(880,320) changed to 75 percent below
MembersToAddBox=Location(922,346)
#WelcomeMesgBox=Location(915,415)
#sometimes the gmail profile comes in the above spot
#WelcomeMesgBox=Location(1180,446) changed to 75 percent below
WelcomeMesgBox=Location(1138,438)
#TextEditOnTaskbar=Location(751,751)
#Taskbar location is often non-reproducable, avoid.
TextEditOnTaskbar=Location(600,31)
InsideTextEdit=Location(650,400)
#MemberListOnTaskbar=Location(435,751)
#SendButton=Location(1164,555) changed to 75 percent below
#SendButton=Location(1146,520) changed for 10 at a time to
SendButton=Location(1128,543)

while(True):  
  click(lastlineofsheet)
  type(Key.DOWN, KeyModifier.SHIFT)
  type(Key.DOWN, KeyModifier.SHIFT)
  type(Key.DOWN, KeyModifier.SHIFT)
  type(Key.DOWN, KeyModifier.SHIFT)
  type(Key.DOWN, KeyModifier.SHIFT)
  type(Key.DOWN, KeyModifier.SHIFT)
  type(Key.DOWN, KeyModifier.SHIFT)
  type(Key.DOWN, KeyModifier.SHIFT)
  type(Key.DOWN, KeyModifier.SHIFT)
  sleep(sleeptime)
  type("c",KeyModifier.CTRL)
  sleep(sleeptime)
  click(Addbutton)
  sleep(sleeptime)
  sleep(sleeptime)
  sleep(sleeptime)
  click(DirectAddToggle)
  sleep(sleeptime)
  click(MembersToAddBox)
  sleep(sleeptime)
  type("v",KeyModifier.CTRL)

  click(TextEditOnTaskbar)
  click(InsideTextEdit)
  sleep(sleeptime)
  type("a",KeyModifier.CTRL)
  type("c",KeyModifier.CTRL)
  #click(MemberListOnTaskbar)
  sleep(sleeptime)
  click(WelcomeMesgBox)
  sleep(sleeptime)
  type("v",KeyModifier.CTRL)
  
  popup("waiting for paste")
  click(SendButton)
  popup("waiting for no error")
  #sleep(7.0)
  
  click(lastlineofsheet)
  sleep(sleeptime)
  type(Key.DOWN)
  sleep(sleeptime)
  #popup("waiting for next")

No comments:

Post a Comment