叶子绿

分享自己的一些前端经验,做改变世界的产品。 再次出发…

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

The Best Translation Service for Apps, Websites & E-commerc

one_sky-ruby

自己也写了php的脚本去测试 oneSky 提供的api, 下载功能测试不成功…应该是oneSky的bug.

   1:  <?php
   2:   
   3:  $secret_key = "FZugx8StWxm8h2kffiLNeAY9Ah9btPVY";
   4:  $platform_id = "10523";
   5:  $url =  "http://api.oneskyapp.com/2/";
   6:  $timestamp = time();
   7:   
   8:  $params = array(
   9:    "api-key" =>  "Fg53fOm1cz0jrbpxj1borZoS7nUq3Ffy",
  10:    "timestamp" => $timestamp,
  11:    "dev-hash" => md5($timestamp . $secret_key),
  12:    "platform-id" => $platform_id 
  13:  );
  14:   
  15:  function request($url,$params,$flag='get',$post_data=array()) {
  16:    $url .= '?' . http_build_query($params);
  17:    $ch = curl_init();
  18:   
  19:    curl_setopt($ch, CURLOPT_URL, $url);
  20:    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  21:   
  22:    if ($flag == "post") {
  23:      curl_setopt($ch, CURLOPT_POST, true); 
  24:      !empty($post_data) and curl_setopt($ch, CURLOPT_POSTFIELDS,$post_data );
  25:    }
  26:   
  27:    $result = curl_exec($ch); 
  28:    curl_close($ch);
  29:   
  30:    echo $result;
  31:  }
  32:  $api = "string/output";
  33:  $config = array (
  34:    "locale" => "zh_TW"
  35:  );
  36:  request($url . $api,array_merge($params,$config));
  37:   
  38:  //文件上传
  39:  $api = "string/upload";
  40:  $post_data = array (
  41:    "file" => "@" . getcwd() . "/share.php",
  42:    "format" => "PHP",
  43:    "callback-url" => "127.0.0.1"
  44:  );
  45:  request($url . $api, $params, "post",$post_data);
  46:   
  47:  //文件下载
  48:  $api = "string/download";
  49:  $config = array (
  50:    "locale" => "zh_TW",
  51:    "format" => "PHP"
  52:  );
  53:   
  54:  request($url . $api,array_merge($params,$config));
  55:  ?>

另外,将gvim升级到了gvim74,64位的.

要支持 command-T,需要安装 Ruby 2.0.0-p247 (x64)DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe, gcc也要64位的,测试了好久..

要将 C:\devkit\mingw\bin 添加系统路径…

有时候就想,干脆换到了linux系统算了. 反正平时做的工作基本是ssh 到 Debian再工作..

posted on 2013-08-23 18:22  叶子绿  阅读(673)  评论(0编辑  收藏  举报