Page Actions
Wiki Actions
User Actions
Submit This Story

用curl发twitter,windows版本

利用windows版的curliconv

FOR /f %%g in ('echo %1 ^| iconv -f gbk -t utf-8') DO curl -x 127.0.0.1:8123 -u methuselar -d status=%%g -d source="cURL" http://twitter.com/statuses/update.xml

之前一直必须用两个bat或者写临时文件的方式向curl传递iconv转码后的字符串,但是经人点拨突然想起来以前拿for /f折腾过参数…于是终于缩减到了一行…

注:

  • 127.0.0.1:8123是我本地的翻墙polipo.
  • -u 可以指定username:passwd

-d source=“cURL” 一定要加上, 显得Cool…

                         ''~``
                        ( o o!)
___________________.oooO__(_)__Oooo._________________________________
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__
_|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|
___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|___|__

Discussion

Enter your comment
 
 
blog/2010/07/curl_twitter_windows.txt · Last modified: 2010/07/20 23:03 by MeaCulpa     Back to top
Recent changes RSS feed Creative Commons License Powered by PHP Driven by DokuWiki