This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "time" | |
| ) | |
| // Fake a long and difficult work. | |
| func DoWork() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Created by PhpStorm. | |
| * User: wangjunfengze | |
| * Date: 2017/8/12 | |
| * Time: 下午2:54 | |
| */ | |
| $money = 6988; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private function doFetch() | |
| { | |
| $header[] = "Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"; | |
| $header[] = "Accept-Language:zh-CN,zh;q=0.8,zh-TW;q=0.6,en;q=0.4"; | |
| $header[] = "Cache-Control:max-age=0"; | |
| $header[] = "Connection:keep-alive"; | |
| $header[] = "DNT:1"; | |
| $header[] = "Host:www.amazon.cn"; | |
| $header[] = "Upgrade-Insecure-Requests:1"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function actionJd() | |
| { | |
| $first = JdSku::model()->find("fetched = 0"); | |
| echo $first->sku."\n\n"; | |
| $this->doFetch($first->sku); | |
| $first->fetched = 1; | |
| $saved = $first->save(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function actionJd() | |
| { | |
| $first = JdSku::model()->find("fetched = 0"); | |
| echo $first->sku."\n"; | |
| $this->doFetch($first->sku); | |
| $first->fetched = 1; | |
| $first->save(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function isEnglish(s) | |
| { | |
| for(var i=0;i<s.length;i++) | |
| { | |
| if(s.charCodeAt(i)>126) | |
| { | |
| return false; | |
| } | |
| } | |
| return true; |