-
Notifications
You must be signed in to change notification settings - Fork 1
frontconnect/autoTextGen
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
For voice recognition project, a voice database needed to be generated. For this purpose, a list of voice donators should be found, uniqe texts should be found from books, blogs, newspaper, etc. When those texts are read by unique users, the related text should be matched with the current This project is developed for generating user specific emails for voice donators. About hundreds of text mails are sent to the users. This project is developed to automatically generate and send emails. * users.csv has the email list of the users. * first of all texts are found and saved below mails-inp folder * hash-mails.sh bash script generates hash codes for each text. * assign-texts.sh assigns texts to the users listed at user.csv file * prepare-attachments.sh creates a zip file for a specific user * send-mails.sh automatically mails the zip file to the respective users. Below, is a complete example to mail texts to the given users. $ tree . ├── assign-texts.sh ├── hash-mails.sh ├── mails-inp │ ├── 1.txt │ ├── f │ │ └── k │ │ └── l │ │ ├── 33.txt │ │ └── 42.txt │ └── hede_1.txt └── users.csv 4 directories, 7 files $ ./hash-mails.sh Usage: ./hash-mails.sh <INPUT-DIR> <OUTPUT-DIR> $ ./hash-mails.sh mails-inp mails-out $ tree . ├── assign-texts.sh ├── hash-mails.sh ├── mails-inp │ ├── 1.txt │ ├── f │ │ └── k │ │ └── l │ │ ├── 33.txt │ │ └── 42.txt │ └── hede_1.txt ├── mails-out │ ├── 0e6830d0046b821e146076ff021fd027.txt │ ├── 216f01333c95d24a7454a6cef25d64d9.txt │ ├── 9920ba99ddd2cb2bae988b26c8dc33c2.txt │ └── ad1ad1db706ea0adb88cd8c331d8415d.txt └── users.csv 5 directories, 11 files $ cat users.csv 43,vy@gmail.com,Volkan 12,ya@gmail.com,Yaprak $ ./assign-texts.sh Usage: ./assign-texts.sh <TEXT-DIR> <USERS-FILE> <N-TEXT> <OUT_DIR> <TEXT-DIR> Directory to search for text files. <USERS-FILE> CVS file for the list of users. <N-TEXT> Number of texts to be assigned. <OUT-DIR> Output directory. $ ./assign-texts.sh mails-out users.csv 5 mails-fin There are 4 texts available in 'mails-out'. And there are 2 users in 'users.csv'. But 5x2=10 texts are required. $ ./assign-texts.sh mails-out users.csv 2 mails-fin $ tree . ├── assign-texts.sh ├── hash-mails.sh ├── mails-fin │ ├── vy@gmail.com │ │ ├── 1.txt │ │ └── 2.txt │ └── ya@gmail.com │ ├── 1.txt │ └── 2.txt ├── mails-inp │ ├── 1.txt │ ├── f │ │ └── k │ │ └── l │ │ ├── 33.txt │ │ └── 42.txt │ └── hede_1.txt ├── mails-out │ ├── 0e6830d0046b821e146076ff021fd027.txt │ ├── 216f01333c95d24a7454a6cef25d64d9.txt │ ├── 9920ba99ddd2cb2bae988b26c8dc33c2.txt │ └── ad1ad1db706ea0adb88cd8c331d8415d.txt └── users.csv 8 directories, 15 files $ ./prepare-attachments.sh Usage: ./prepare-attachments.sh <USERS-FILE> <INPUT-DIR> <OUTPUT-DIR> <USERS-FILE> CVS file for the list of users. <INPUT-DIR> Directory generated by "assign-texts.sh" script. <OUTPUT-DIR> Output directory. $ ./prepare-attachments.sh users.csv mails-fin mails-zip updating: 1.txt (deflated 9%) updating: 2.txt (deflated 8%) updating: README.html (deflated 74%) updating: 1.txt (deflated 11%) updating: 2.txt (deflated 7%) updating: README.html (deflated 74%) $ tree mails-zip mails-zip ├── 12 │ ├── 1.txt │ ├── 2.txt │ └── README.html ├── 43 │ ├── 1.txt │ ├── 2.txt │ └── README.html ├── ses_kayit_12.zip └── ses_kayit_43.zip 2 directories, 8 files $ grep ^SMTP send-mail.py SMTP_SERVER = "smtp.gmail.com" SMTP_PORT = 587 SMTP_USERNAME = "vy@gmail.com" SMTP_PASSWORD = "xxx" SMTP_FROM = "VY <vy@gmail.com>" SMTP_CC = "VY <vy@gmail.com>" $ ./send-mails.sh Usage: ./send-mails.sh <USERS-FILE> <INPUT-DIR> <MAIL-SUBJECT> <MAIL-BODY-PATH> <USERS-FILE> CVS file for the list of users. <INPUT-DIR> Directory generated by "prepare-attachments.sh" script. <MAIL-SUBJECT> Subject of the will be sent mails. <MAIL-BODY-PATH> File containing the mail body text. $ ./send-mails.sh users.csv mails-zip "Neoses deneme" mail-body.txt ... ... ...
About
Automatic text generating and mail sending scripts
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published