Platinum Partner

Build Blacklist .htaccess File

I run ./blacklist_builder.py > .htaccess  every week or so... 

 """
    blacklist_builder.py
    Get the entries from a blacklist
    and print them to standard output
    """
  
    latest = urllib2.urlopen("http://www.unknowngenius.com/blog/blacklist/")
    
     str = ''
    
     begin = "RewriteCond %{HTTP_REFERER} ^.*"
     for line in latest:
         str+= begin+ re.sub('(\s#:url:|\s#:regex-url:|\s#:rbl:)',
                                   ".*$ [OR]\n",line)
            
        return str


Output looks like this...
RewriteCond %{HTTP_REFERER} ^.*zpics.net.*$ [OR]
RewriteCond %{HTTP_REFERER} ^.*zt148.com.*$ [OR]
RewriteCond %{HTTP_REFERER} ^.*zum-bestpreis.de.*$ [OR]
RewriteCond %{HTTP_REFERER} ^.*zxyzxy.com.*$ [OR]
RewriteCond %{HTTP_REFERER} ^.*fondos-pantalla..*$ [OR]
RewriteCond %{HTTP_REFERER} ^.*.kucko.com.*$ [OR]
RewriteCond %{HTTP_REFERER} ^.*.gogof-ck.com.*$ [OR]

 .....
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}