|
@@ -6,6 +6,51 @@
|
|
|
*/
|
|
|
class CommonFn
|
|
|
{
|
|
|
+
|
|
|
+ //替换爬虫中的url
|
|
|
+ public static function replaceUrl($tmp_str){
|
|
|
+ $_tmp_str = str_replace('pics.wozhua.mobi','wozhua-pics.qiniudn.com',$tmp_str);
|
|
|
+ $_tmp_str = str_replace('wozhua-video.qiniudn.com','7rfl3z.com2.z0.glb.qiniucdn.com',$_tmp_str);
|
|
|
+
|
|
|
+ $_tmp_str = str_replace('7o52dq.com2.z0.glb.clouddn.com','wozhua-avatars.qiniudn.com',$_tmp_str);
|
|
|
+ $_tmp_str = str_replace('avatars.wozhua.mobi','wozhua-avatars.qiniudn.com',$_tmp_str);
|
|
|
+
|
|
|
+ $_tmp_str = str_replace('7oxep6.com2.z0.glb.clouddn.com','avatars.maiyizhi.cn',$_tmp_str);
|
|
|
+ $_tmp_str = str_replace('7oxer3.com2.z0.glb.qiniucdn.com','icons.maiyizhi.cn',$_tmp_str);
|
|
|
+ $_tmp_str = str_replace('wozhua-pics.qiniudn.com','pics.maiyizhi.cn',$_tmp_str);
|
|
|
+ $_tmp_str = str_replace('7rfl3z.com2.z0.glb.qiniucdn.com','video.maiyizhi.cn',$_tmp_str);
|
|
|
+ $_tmp_str = str_replace('wozhua-avatars.qiniudn.com','others.maiyizhi.cn',$_tmp_str);
|
|
|
+ $_tmp_str = str_replace('7oxep5.com2.z0.glb.clouddn.com','static.maiyizhi.cn',$_tmp_str);
|
|
|
+ $_tmp_str = str_replace('files.appcute.im','cwsc-files.maiyizhi.cn',$_tmp_str);
|
|
|
+
|
|
|
+ return $_tmp_str;
|
|
|
+ }
|
|
|
+
|
|
|
+ //替换七牛的ssl url
|
|
|
+ public static function replaceSshUrl($tmp_str){
|
|
|
+ $_tmp_str = str_replace('ogbtdokqr.qnssl.com','avatars.maiyizhi.cn',$tmp_str);
|
|
|
+ $_tmp_str = str_replace('ogrzjw8in.qnssl.com','icons.maiyizhi.cn',$_tmp_str);
|
|
|
+
|
|
|
+ $_tmp_str = str_replace('oi02dsdsh.qnssl.com','others.maiyizhi.cn',$_tmp_str);
|
|
|
+ $_tmp_str = str_replace('ogrzx2jit.qnssl.com','pics.maiyizhi.cn',$_tmp_str);
|
|
|
+
|
|
|
+ $_tmp_str = str_replace('ogrz13ent.qnssl.com','video.maiyizhi.cn',$_tmp_str);
|
|
|
+ $_tmp_str = str_replace('ogrzaxwjy.qnssl.com','test.maiyizhi.cn',$_tmp_str);
|
|
|
+ $_tmp_str = str_replace('oi0318gy3.qnssl.com','static.maiyizhi.cn',$_tmp_str);
|
|
|
+
|
|
|
+ return $_tmp_str;
|
|
|
+ }
|
|
|
+
|
|
|
+ //生成水印签名
|
|
|
+ public static function buildSign($name){
|
|
|
+ return base64_encode($name.'@买一只');
|
|
|
+ }
|
|
|
+
|
|
|
+ //获得七牛图片的尺寸
|
|
|
+ public function getPicSize($url){
|
|
|
+ $resources = self::simple_http($url."?imageInfo");
|
|
|
+ return json_decode($resources, true);
|
|
|
+ }
|
|
|
/**
|
|
|
* 获取easyui datagrid分页参数 返回 limit, offset, order 如果no_page=1 不分页
|
|
|
*/
|