This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function searchAndReadPDFs() { | |
var threads = GmailApp.search("from:info@wolt.com has:attachment filename:pdf"); | |
for (var thread of threads){ | |
Logger.log(thread.getId()); | |
var foundCodes = []; // TODO use Set | |
for (var message of thread.getMessages()){ | |
for (var attachment of message.getAttachments()) { | |
Logger.log(message.getSubject()); | |
Logger.log(message.getDate()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
DB_FILE = r"PATH\TO\DB\FILE" | |
GROUP_ID = GROUP_ID \\ see messages.key_remote_jid, appears after the "@" sign | |
con = sqlite3.connect(DB_FILE) | |
with con: | |
cur = con.cursor() | |
image_paths = cur.execute(f"select file_path from message_media where " |