找到apistatusesupdate.php文件,找到代码行:
232 233 | $content = html_entity_decode($status_shortened, ENT_NOQUOTES, 'UTF-8'); $options = array('reply_to' => $reply_to); |
修改代码如下:
232 233 234 235 236 237 238 239 240 241 | $content = html_entity_decode($status_shortened, ENT_NOQUOTES, 'UTF-8'); //add by jianhong 20110211 if((preg_match("/^http:/",$content))||(preg_match("/http:/",$content)&&$this->source=="api")){ $this->clientError("I hate you!!! spam maker!!!"); return; } //add by jianhong 20110211 $options = array('reply_to' => $reply_to); |
当我们在使用statusnet当中的google map时,发现那个放大缩小的level条不见了。这样很不方便使用。加上它其实并不难。打开\plugins\Mapstraction\js\mxn.google.core.js文件,在原代码:
1 2 3 4 5 6 7 8 9 10 11 12 | mxn.register('google', { Mapstraction: { init: function(element,api) { var me = this; if (GMap2) { if (GBrowserIsCompatible()) { this.maps[api] = new GMap2(element); GEvent.addListener(this.maps[api], 'click', function(marker,location) { ... |
改变为:
786d8d2630ff8f1daa7790c699b7964[......]
上一次提到这个问题的时候,似乎感觉问题解决了,但是后来发现,上次的代码并不能很好的解决问题,很多中英文混杂的标题无法正确的显示。
为此,不得不再次研究一下代码,将代码做了一下精减,反而效果还是不错的。具体代码如下:
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | function cleanup_mail($string) { $string = str_replace(array("\r", "\n", "\r\n"), "", $string); $string = trim($string); return $string; } function utf8_encode_c($string) { $charset = 'utf-8'; $encoded_string = $string; if(strtolower($charset) == 'utf-8' && preg_match('/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\xff]/', $string)) { // Define start delimimter, end delimiter and spacer $end = "?="; $start = "=?" . $charset . "?B?"; // Encode the string $encoded_string = base64_encode($encoded_string); $encoded_string = $start . $encoded_string . $end; } return $encoded_string; } function mail_send($recipients, $headers, $body) { // XXX: use Mail_Queue... maybe $backend = mail_backend(); if (!isset($headers['Content-Type'])) { $headers['Content-Type'] = 'text/plain; charset=UTF-8'; $headers['Subject'] = utf8_encode_c(cleanup_mail($headers['Subject'])); } assert($backend); // throws an error if it's bad $sent = $backend->send($recipients, $headers, $body); if (PEAR::isError($sent)) { common_log(LOG_ERR, 'Email error: ' . $sent->getMessage()); return false; } return true; } |
最近,Barracuda Labs发布了一项统计研究,主要是关于Twitter的,还包括电子邮件及恶意软件的统计。
这项研究共统计了约1900万twitter用户。结果表明,只有21%的twitter用户是活跃用户(所谓活跃用户的定义是:有至少10个followers, follows至少十人,发推tweet十次以上)。至2009年12月,仅有26%的推客有10个以上的followers,有40%的推客follows不少于10人。实际上,有51%的人following少于五人。
有34%的推客只是注册,却一次推都没有发过。73%的推客发了少于10条的推。这就是说,几乎所有的推都来自于1/4的推客。而且,并不是有最多followers的人发推最多,往往是拥有100个左右followers发推比较多。
[......]
semiocast.com发表了一项调查,调查表明,从2月8号至2月10号的这24小时内,twitter上的推,有一半为英语。在剩余的那一半当中,排在前四位的是日语(14%),葡萄牙语(9%),马来语(6%),西班牙语(4%)。而余下的17%为41种语言,每种不到2%。
Tags: 微博



近期评论