This file contains hidden or 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 | |
| import os | |
| from io import BytesIO | |
| from PIL import Image | |
| from pathlib import Path | |
| import argparse | |
| # Parse command-line arguments | |
| parser = argparse.ArgumentParser(description='Process some data.') | |
| parser.add_argument('--skip-backup', action='store_true', help='Do not write files to disk') |
THis gist was created in 2016 and I haven't been working with Facebook Leads ever since. As a result, this guide might not be accurate.
Please check @eladnava's updated step-by-step guide for 2020 here: https://eladnava.com/get-facebook-ad-lead-notifications-in-realtime-with-node-js-webhooks/
This file contains hidden or 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
| DROP TABLE IF EXISTS time_dimension; | |
| CREATE TABLE time_dimension ( | |
| id INTEGER PRIMARY KEY, -- year*10000+month*100+day | |
| db_date DATE NOT NULL, | |
| year INTEGER NOT NULL, | |
| month INTEGER NOT NULL, -- 1 to 12 | |
| day INTEGER NOT NULL, -- 1 to 31 | |
| quarter INTEGER NOT NULL, -- 1 to 4 | |
| week INTEGER NOT NULL, -- 1 to 52/53 | |
| day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'... |