P.i..c.a.s.a被墙之后的解决方法

    某日老妈说我的blog上都是小红叉叉,让我大吃一惊,GFW终于向P.i..c.a.s.a动手了!我blog上的图片很多都是从那上面链接过来的,让别人都翻墙访问是不现实的,图片全都搬家是更不现实的。此时GFW Blog转载了一篇解决最近刚刚出现的图片红叉问题,解了我的燃眉之急。原文的blog在这里

    此法适用于空间在国外,需要把P.i..c.a.s.a的图片翻到墙内的童鞋。实际步骤是:
1)到这里下载pika(from 生活点滴),解压后,readimg.php里面按照注释的解释,把路径改成自己的url,上传到空间上。

2)在footer.php的</body>之前加上下列代码:
google api已经被墙了,所以
http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
必须改为
http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js

P。i。casa的服务器域名也变了,请自行把下面的代码添加两遍,第2遍把“ggpht”替换为“googleusercontent”

<script language=”JavaScript” type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js”></script>
<script language=”JavaScript”>
$(”img “).each(function(i){//遍历本页所有的图片
var src = $(this).attr(”src”);
if( src.indexOf(’ggpht’)!=-1 ){//如果图片来自某个地方,则替代之
$(this).attr(”src”,”http://0bad.com/readimg.php?src=”+src.replace(”ggpht”,”gouride”) );//则将图片地址改成转发的地址,记住ggpht替代掉,因为这个会触发墙
}
});
</script>

<script language=”JavaScript” type=”text/javascript” src=”http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js”></script>
<script language=”JavaScript”>
$(”img “).each(function(i){//遍历本页所有的图片
var src = $(this).attr(”src”);
if( src.indexOf(’ggpht’)!=-1 ){//如果图片来自某个地方,则替代之
$(this).attr(”src”,”http://0bad.com/readimg.php?src=”+src.replace(”ggpht”,”gouride”) );//则将图片地址改成转发的地址,记住ggpht替代掉,因为这个会触发墙
}
});
</script>

    就大功告成了。当然上面的代码不要完全照抄啊,路径都要改成你自己的空间的链接。之后你的网站上引自P.i..c.a.s.a的图片的地址已经成为自己的空间的地址了。这些代码是遇到网页里有引用自P.i..c.a.s.a的图片,就让pika里面那个readimg.php去把图片缓存到自己的空间,让blog的访问者可以正常看到。

    不过听说最近GFW开始劫持国外的DNS了,如果有一日,未经翻墙的话、国外非官方认可网站统统无法访问,那也只有orz了……

P.i..c.a.s.a被墙之后的解决方法》上有7条评论

  1. Pingback引用通告: 细节的力量

  2. dashuai

    用不来,我的pica图片就是用在页面里面做了一个album相册,好像没法用这个插件来显示,不过图片链接地址确实已经修改了,只是还是无法显示而已

    [回复]

    回复
  3. Pingback引用通告: hyac's blog - 生活在别处

  4. Pingback引用通告: hyac's blog - 生活在别处

  5. project365.co.uk

    While free accounts cannot schedule updates in large quantities, you can still schedule
    as numerous updates as you desire individually. This is a thing tat social
    networking can simply afford a little business. These companies usse Twitter advertising in promoting your products or services, services, messages and website therefoee means that both your revenue and recognition are increased,thus bringing about further expansion for
    both you and also the company you use.

    [回复]

    回复

willerce进行回复 取消回复

邮箱地址不会被公开。 必填项已用*标注