<?php
/*
Plugin Name: Flickr Passes GFW
Plugin URI: http://blog.istef.info/#
Description: F*ck GFW 2 death!!
Author: Liu Yang (iStef)
Version: 1.0
Author URI: http://blog.istef.info/

*/ 

function flickr_pass_gfw($text) {
  
$matches = array("/<img(.+?)src=\"http:\/\/farm1\.static\.flickr\.com\/(.*?)\"(.*?)>/i",
                   
"/<img(.+?)src=\"http:\/\/farm2\.static\.flickr\.com\/(.*?)\"(.*?)>/i",);
  
$replaces = array("<img$1src=\"http://68.142.232.116/$2\"$3>",
                   
"<img$1src=\"http://69.147.123.56/$2\"$3>");
  
$text preg_replace($matches,$replaces,$text);
  return 
$text;
}

add_filter('the_content''flickr_pass_gfw');
add_filter('the_excerpt''flickr_pass_gfw');

?>