Skip to content

Instantly share code, notes, and snippets.

@markjaquith markjaquith/fcc.php
Created Jul 2, 2011

Embed
What would you like to do?
I hear the FCC wrote a WordPress plugin. This is what I expected it to be.
<?php
class FCC_Safe_Harbor_Indecency_Plugin {
static $instance;
private $seven_dirty = array(
'shit(s|ty|head)?' => '{BLEEP}$1',
'piss(es|ed|ing)?' => '{BLEEP}$1',
'fuck(s|er|ers|ing|ed)?' => '{BLEEP}$1',
'cunt([ys])?' => '{BLEEP}$1',
'cock(sucker[s]?)' => '{BLEEP}$1',
'(mother)fuck(s|er|ers|ing|ed)?' => '$1{BLEEP}$2',
'tit(s|ty|ties)?' => '{BLEEP}$1',
);
public function __construct() {
$hour = date( 'G', current_time( 'timestamp' ) );
if ( $hour < 22 && $hour > 6 ) {
add_filter( 'the_content', array( $this, 'the_content' ) );
}
}
public function the_content( $content ) {
foreach ( $this->seven_dirty as $word => $replacement ) {
$content = preg_replace( '#\b' . $word . '\b#i', $replacement, $content );
}
return $content;
}
}
new FCC_Safe_Harbor_Indecency_Plugin;
@markjaquith

This comment has been minimized.

Copy link
Owner Author

markjaquith commented Jul 2, 2011

See their actual plugin here.

@remkus

This comment has been minimized.

Copy link

remkus commented Jul 2, 2011

Too funny :)

@alisonmf

This comment has been minimized.

Copy link

alisonmf commented Jul 3, 2011

This is amazing!

@skeltoac

This comment has been minimized.

Copy link

skeltoac commented Jul 4, 2011

Shouldn't the client's time zone be used?

@markjaquith

This comment has been minimized.

Copy link
Owner Author

markjaquith commented Jul 4, 2011

@skeltoac Oddly, I researched this. No, it goes according to the time zone of the "station." So stations near time zone borders that send signals into other time zones aren't judged by the time in the receiver's time zone.

@skeltoac

This comment has been minimized.

Copy link

skeltoac commented Jul 4, 2011

@markjaquith In that case, distribute the blog onto several hosts around the world and use DNS to switch stations as the time changes. Always be "broadcasting" from where it is 2200-0600.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.