Skip to content

Instantly share code, notes, and snippets.

View jennyscript's full-sized avatar

Jenny Steele jennyscript

View GitHub Profile
const Box = x =>
({
map: f => Box(f(x)),
fold: f => f(x),
toString: () => `Box(${x})`
})
// Exercise: Box
// Goal: Refactor each example using Box
// Keep these tests passing!
import requests
from bs4 import BeautifulSoup
result = requests.get("https://medium.com/@WomenWhoCode/latest")
soup = BeautifulSoup(result.content)
titles = soup.find_all("a", "block-snippet")
[{"title":title.string.strip(),"url":title.attrs['href']} for title in titles]