Skip to content

Instantly share code, notes, and snippets.

@grahamc
Forked from anonymous/etcfocus_blacklist.py.txt
Created May 16, 2012 13:40
Show Gist options
  • Save grahamc/2710403 to your computer and use it in GitHub Desktop.
Save grahamc/2710403 to your computer and use it in GitHub Desktop.
/etc/focus_blacklist.py
# vim:ts=4
import re
def domain_liveleak_com(dt):
if dt.hour < 8 or dt.hour > 18:
return True
if dt.weekday > 4:
return True
return False
def domain_news_ycombinator_com(dt):
# return dt.hour % 2 # every other hour
return False
def domain_reddit_com(dt):
# return dt.hour in (12, 21) # at noon-1pm, or from 9-10pm
return False
def domain_facebook_com(dt):
return False
def default(domain, dt):
# do something with regular expressions here?
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment