Skip to content

Instantly share code, notes, and snippets.

View DeveloperMeier's full-sized avatar

Colby Meier DeveloperMeier

  • LifePoint Mobile, LLC
  • Denver, Colorado
View GitHub Profile
import re
import bs4
import urllib2
root = "http://www.ted.com"
req = urllib2.Request(root + "/talks/quick-list")
html = urllib2.urlopen(req).read()
while html:
talks = bs4.BeautifulSoup(html)
@albrow
albrow / confirm.go
Last active April 16, 2023 03:03
Go (golang): How to ask for user confirmation via command line
import (
"fmt"
"log"
"os"
"sort"
)
// askForConfirmation uses Scanln to parse user input. A user must type in "yes" or "no" and
// then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as
// confirmations. If the input is not recognized, it will ask again. The function does not return