Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.27 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. def get_channel(request):
  2.     """Returns the google ad sense channel for a host."""
  3.     host = request.META.get('HTTP_HOST')
  4.     if 'AD_CHANNELS' in request.context:
  5.         for x, y in request.context['AD_CHANNELS']:
  6.             if x in host:
  7.                 return y