{"id":56062,"date":"2020-04-05T03:02:32","date_gmt":"2020-04-04T19:02:32","guid":{"rendered":"http:\/\/4563.org\/?p=56062"},"modified":"2020-04-05T03:02:32","modified_gmt":"2020-04-04T19:02:32","slug":"%e6%b5%8b%e8%af%95golang%e7%94%9f%e6%88%90%e7%9a%84%e4%b8%80%e4%b8%aa%e7%ae%80%e5%8d%95%e7%88%ac%e8%99%abexe","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=56062","title":{"rendered":"\u6d4b\u8bd5golang\u751f\u6210\u7684\u4e00\u4e2a\u7b80\u5355\u722c\u866bexe"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>yjsx86<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u6d4b\u8bd5golang\u751f\u6210\u7684\u4e00\u4e2a\u7b80\u5355\u722c\u866bexe<\/h3>\n<p>  \t\t \u672c\u5e16\u6700\u540e\u7531 yjsx86 \u4e8e 2020-4-2 22:26 \u7f16\u8f91 <\/p>\n<p> \u6211\u8fd9\u91cc\u672c\u5730\u73af\u5883\u751f\u6210\u7684exe \u4e0d\u77e5\u9053\u4f60\u4eec\u80fd\u4e0d\u80fd\u6253\u5f00<br \/>  \u6293\u53d6https:\/\/www.google.com\/doodles\/json\/2020\/3?hl=zh_CN\u7684json\u7136\u540e\u5c55\u793a<br \/>  \u4f7f\u7528\u4f60\u4eec\u7684\u672c\u5730\u4ee3\u7406127.0.0.1:1080, \u5c31\u662f\u8bf4\u4f60\u4eec\u8981\u5f00\u7740ss\u6216\u8005ssr \u7aef\u53e3\u8981\u662f1080\u7684<br \/>  \u76f4\u63a5\u5199\u6b7b \u53ea\u662f\u6d4b\u8bd5\u7528<br \/>  \u76f4\u63a5\u751f\u6210 5\u5146\u591a, \u7528upx\u538b\u7f29\u540e1.75\u5146<\/p>\n<p>  exe\u6587\u4ef6:https:\/\/www.lanzous.com\/iaxmira<br \/>  \u8fd9\u662f\u6587\u4ef6\u626b\u63cf:https:\/\/r.virscan.org\/language\/zh-cn\/report\/f002ed93d0f1ff2eb9f2fd92879de25b<\/p>\n<p>  \u4ee3\u7801\u5728\u4e0b\u9762<br \/>  package main<\/p>\n<p>  import (<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &quot;encoding\/json&quot;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &quot;fmt&quot;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &quot;io\/ioutil&quot;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &quot;log&quot;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &quot;net\/http&quot;<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &quot;net\/url&quot;<br \/>  )<\/p>\n<p>  type Some struct {<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; Url&nbsp; &nbsp;string<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; Title string<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; Dates []int `json:&quot;run_date_array&quot;`<br \/>  }<\/p>\n<p>  var client = NewHttpClient(&quot;http:\/\/127.0.0.1:1080&quot;)<\/p>\n<p>  func main() {<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; var wait string<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; GetData(2020, 3)<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; fmt.Printf(&quot;nnnPress any key exit.n&quot;)<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; fmt.Scanln(&amp;wait)<br \/>  }<\/p>\n<p>  func GetData(year, month int){<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; url := fmt.Sprintf(&quot;https:\/\/www.google.com\/doodles\/json\/%d\/%d?hl=zh_CN&quot;, year, month)<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; fmt.Println(&quot;\u6b63\u5728\u6293\u53d6: &quot;, url)<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; resp, err := client.Get(url)<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; if err != nil {<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; log.Fatalln(err)<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; defer resp.Body.Close()<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; var data []Some<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; all, err := ioutil.ReadAll(resp.Body)<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; if err != nil {<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; log.Fatalln(err)<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; json.Unmarshal(all, &amp;data)<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; for _, d := range data {<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fmt.Printf(&quot;%#vn&quot;, d)<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>  }<\/p>\n<p>  func NewHttpClient(proxyAddr string) *http.Client {<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; var proxy = func(_ *http.Request) (*url.URL, error) {<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return url.Parse(proxyAddr)<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; netTransport := &amp;http.Transport{<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Proxy: proxy,<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; }<\/p>\n<p>  &nbsp; &nbsp; &nbsp; &nbsp; return &amp;http.Client{<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Transport: netTransport,<br \/>  &nbsp; &nbsp; &nbsp; &nbsp; }<br \/>  }\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>h20<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u6e90\u7801\u53d1GitHub\u00d7<br \/>  \u5e2e\u4f60\u4eec\u7f16\u8bd1\u597d\u4e86\u221a  \t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>yjsx86<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\th20 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-4-2 22:25<br \/>  \u6e90\u7801\u53d1GitHub\u00d7<br \/>  \u5e2e\u4f60\u4eec\u7f16\u8bd1\u597d\u4e86\u221a<\/p>\n<p> \u4e3b\u8981\u662f\u60f3\u6d4b\u8bd5\u4e0bgolang\u6253\u5305\u7684exe<br \/>  \u4e4b\u524dpython\u6253\u5305exe \u4e0d\u4f7f\u7528\u7b2c\u4e09\u65b9\u5e93 \u6253\u5305\u4e5f\u5f9710m \u8d77\u6b65\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>yjsx86 \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u6d4b\u8bd5&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/56062"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=56062"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/56062\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=56062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=56062"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=56062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}