Skip to content

Instantly share code, notes, and snippets.

import requests
from bs4 import BeautifulSoup
import time
USER_AGENT = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'}
def fetch_results(search_term, number_results, language_code):
assert isinstance(search_term, str), 'Search term must be a string'
assert isinstance(number_results, int), 'Number of results must be an integer'

Keybase proof

I hereby claim:

  • I am techtheory on github.
  • I am jimkopps (https://keybase.io/jimkopps) on keybase.
  • I have a public key ASBOzQ0YiIvRvy1RgBr4xBX9y5OfxR-T0UcWCDAx5T5J0Qo

To claim this, I am signing this object:

@techtheory
techtheory / timeSince.js
Last active August 29, 2015 14:17 — forked from oswaldoacauan/gist:7081881
javascript time since function
function timeSince(date) {
var seconds = Math.floor(((new Date().getTime()/1000) - date)),
interval = Math.floor(seconds / 31536000);
if (interval > 1) return interval + "y";
interval = Math.floor(seconds / 2592000);
if (interval > 1) return interval + "m";
interval = Math.floor(seconds / 86400);

Keybase proof

I hereby claim:

  • I am techtheory on github.
  • I am jimkopps (https://keybase.io/jimkopps) on keybase.
  • I have a public key whose fingerprint is 4D21 EF61 EF89 418C 6695 0AF5 1BD3 01AD A2B3 9886

To claim this, I am signing this object: