Skip to content

Instantly share code, notes, and snippets.

View dfreelon's full-sized avatar

Deen Freelon dfreelon

View GitHub Profile
@dfreelon
dfreelon / top_BMMC_tracks_public.py
Created July 1, 2023 14:02
The code I used to create the #BlackMusicMonthChallenge top tracks playlists for Spotify and YouTube. The code requires valid Spotify and YouTube API credentials.
# -*- coding: utf-8 -*-
# run the following two snscrape commands from a CLI first -- you'll need the dev version from https://github.com/JustAnotherArchivist/snscrape
# future replicators: I recommend using Twitter's "since" and "until" date operators. I used snscrape's built in "since" operator because I ran it on June 30 so didn't need "until"
#for replies: snscrape --since 2023-05-31 --jsonl twitter-search @naima >@naima_replies_all.json
#for QTs: snscrape --since 2023-05-31 --jsonl twitter-search quoted_user_id:78417631 >@naima_qts_all.json
import html
import json
import pandas as pd