Skip to content

Instantly share code, notes, and snippets.

@gammaglitch
gammaglitch / get_all_completed_tasks.py
Created May 24, 2024 10:58
Todoist API: Get all completed tasks. This script makes use of the pagination of the endpoint to aggregate all items before storing them in a CSV file.
import requests
import os
import csv
def get_completed_tasks(offset=0, access_token=None):
url = "https://api.todoist.com/sync/v9/completed/get_all"
headers = {
"Authorization": f"Bearer {access_token}"
}
@gammaglitch
gammaglitch / get_all_completed_tasks.py
Created May 24, 2024 10:55
Todoist API: Get all completed tasks. This script gets the completed tasks on every single day, aggregates them and stores them in a CSV file.
import requests
import os
import csv
from datetime import datetime, timedelta
def get_completed_tasks(date, access_token):
url = "https://api.todoist.com/sync/v9/completed/get_all"
headers = {
"Authorization": f"Bearer {access_token}"
@gammaglitch
gammaglitch / reddit_archive_saved_posts.py
Created January 25, 2023 19:05
This python script scrapes the saved posts of multiple accounts. It also generates a table of contents to use with Obsidian.
import praw
import json
from dotenv import load_dotenv
import os
load_dotenv()
user_agent='python_saved'
with open('config.json') as f: