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
# headers from headers: key of meta parameter to consumer function | |
# Returns {death_count, last_queue_name} | |
def get_death_info([headers: headers] = h) do | |
x_death_tables = Enum.find(headers, fn e -> | |
elem(e, 0) == "x-death" | |
end) |> elem(2) | |
{deaths, last_queue} = Enum.reduce(x_death_tables, {0, ""}, fn {:table, attrs} = e, acc -> | |
IO.puts(inspect(attrs)) | |
in_acc = Enum.reduce(attrs, {0, ""}, fn e, acc -> |
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
#!/usr/bin/python | |
# Download all screencasts currently free (until 10-4-2018) from www.destroyallsoftware.com | |
# Update to set User-Agent | |
from bs4 import BeautifulSoup | |
import os | |
import requests | |
headers = { | |
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36" | |
} |