Skip to content

Instantly share code, notes, and snippets.

@rjchee
rjchee / download.py
Created February 22, 2019 02:35
Download videos
import os
import subprocess
import sys
import xml.etree.ElementTree as ET
with open(sys.argv[1], 'r') as rss:
et = ET.parse(rss)
root = et.getroot()
for name, url in zip((e.text for e in root.findall('./channel/item/title')), (e.attrib['url'] for e in root.findall('./channel/item/enclosure'))):
download_name = f"{name.replace(' ', '-')}.mp4"
@rjchee
rjchee / stressbot.py
Created October 10, 2017 22:27
stressbot
from twython import Twython
API_KEY = '<Your API key here>'
API_SECRET = '<Your API secret here>'
OAUTH_TOKEN = '<Your OAuth token here>'
OAUTH_SECRET = '<Your OAuth secret here>'
twitter = Twython(API_KEY, API_SECRET, OAUTH_TOKEN, OAUTH_SECRET)
twitter.update_status(status="I'm stressed")