真正的加班,应该是:
每天至少要干25个小时的活,每周干8天
(ok,随便发发牢骚)
一个强大的文件下载工具curl
curl是一个利用URL语法在命令行方式下工作的文件传输工具。本文介绍了它的简单用法。
curl是一个利用URL语法在命令行方式下工作的文件传输工具。它支持很多协议:FTP,
FTPS, HTTP, HTTPS, GOPHER, TELNET, DICT, FILE 以及
LDAP。curl同样支持HTTPS认证,HTTP POST方法, HTTP PUT方法, FTP上传, kerberos认证,
HTTP上传, 代理服务器, cookies, 用户名/密码认证, 下载文件断点续传, 上载文件断点续传, http代理服务器管道(
proxy tunneling), 甚至它还支持IPv6, socks5代理服务器,
通过http代理服务器上传文件到FTP服务器等等,功能十分强大。Windows操作系统下的网络蚂蚁,网际快车(FlashGet)的功能它都可以做到。准确的说,curl支持文件的上传和下载,所以是一个综合传输工具,但是按照传统,用户习惯称curl为下载工具。
curl是瑞典curl组织开发的,您可以访问http://curl.haxx.se/获取它的源代码和相关说明。鉴于curl在Linux上的广泛使用,IBM在AIX
Linux Toolbox的光盘中包含了这个软件,并且您可以访问IBM网站http://www-
1.ibm.com/ser
curl的manual(再转·下)4(2007-04-17 16:55)
Sometimes your HTTP access is only available
through the use of a HTTP proxy. This seems to be especially common
at various companies. A HTTP proxy may require its own user and
password to allow the client to get through to the Internet. To
specify those with curl, run something
like: curl -U
proxyuser:proxypassword curl.haxx.se If your proxy requires
the authentication to be done using the NTLM method, use
--proxy-ntlm, if it requires Digest use --proxy-digest. If
you use any one these user+password options but leave out the
password part, curl will prompt for the password
interactively. Do note that when a program is run, its
parameters might be possible to see when listing the running
processes of the system. Thus, other users may be able to watch
your passwords if you pass them as plain command line options.
There are ways to circumvent this. 7. Referer A HTTP request
may include a 'referer' f
curl的Manual(再转·上)3(2007-04-17 16:51)
Online:
http://curl.haxx.se/docs/httpscripting.htmlDate:
December 9,
2004
The Art Of Scripting HTTP Requests Using
Curl
============================================= This document
will assume that you're familiar with HTML and general
networking. The possibility to write scripts is essential to
make a good computer system. Unix' capability to be extended by
shell scripts and various tools to run various automated commands
and scripts is one reason why it has succeeded so well. The
increasing amount of applications moving to the web has made 'HTTP
Scripting' more frequently requested and wanted. To be able to
automatically extract information from the web, to fake users, to
post or upload data to web servers are all im
curl学习(转)2(2007-04-17 16:50)
curl学习
校园网ip网费查询脚本的分析
这个脚本原来是bbs上的一个帖子,我拿出来作为学习curl的资料。
设置cookie,如下:
[jasonh@fbsd bin]$ ./curl.sh
所剩余额: 109.00
[jasonh@fbsd bin]$ cat curl.sh
curl -d
'fr=00&id_ip=YOUR_IP&pass=YOUR_PASSWD&set=%BD%F8%C8%EB'
\
http://hitsun.hit.edu.cn/index1.php -L -D hitsun.cookie \
-b hitsun.cookie
2>&1 |
sed -n 's/^.*\(所剩余额\)\([^0-9]*\)\([0-9.]*\).*/\1: \3/p'
命令分析:
curl
-d/--data <data> HTTP
POST data (H)
--data-ascii <data> HTTP POST
ASCII data (H)
--data-binary <
curl突破限制的一些用法
curl是一個非常好用的下載與上傳的工具,如果有一個一連串的下載與上傳的任務要做,這時後我們就可以使用curl幫助我們.
下面都是一些我在網路上看到不錯的文章(一些使用上的例子),貼在這裡,互相交流學習.
========================================
curl的用法
一、基本抓檔:
% curl -O
'http://blueapple.infor.org/curl/1.txt'
敲入這行指令以後,會出現代表抓檔進度以及速度的文字。
一定有人有過這種經驗:網頁上有許多按照編號命名的檔案,每次都要一個一個點選以後再儲存,實在很煩!要是只有十個二十個那還好,可是要是遇上了好幾百個、好幾千個檔案呢?curl提供了連續抓檔案的功能:
% curl -O
'http://blueapple.infor.org/curl/mac/[1-10].jpg'
三、續傳檔案:
有的時候抓檔抓到一半就斷線是
不得不推荐的小说--小夫妻天天恶战(2007-04-03 21:14)
强文首发在天涯,随后即被疯狂转贴,终于今天开始在17k连载。
登陆17k首日即创下双榜第一的成绩。极其彪悍!
我也不得不激烈的顶一下了。
网页上玩的即时互动休闲游戏《生存岛》(2007-03-29 10:19)
(应该是抓取吧,嘿嘿)
这种做法是否道德,是否有法律问题都不论。
一些回复倒是相当恶搞:
张朝阳,这是你的点子吗?怎么这么损?这不是行业恶性竞争么???!!!“MSN空间……
作者: 匿名 2007-03-12 22:38:10
只能说。。。可怜的张朝阳啊。。。
CURL模拟访问网页(转)(2007-03-09 23:07)
最近在搞些有趣的东西,比如类似抓取什么的。
所以用到了curl,这玩意儿不错,可以设置cookie,代理,甚至于header,referer
下边都是转的:
bool curl_setopt (int ch, string option, mixed value)
curl_setopt()函数将为一个CURL会话设置选项。option参数是你想要的设置,value是这个选项给定的值。
下列选项的值将被作为长整形使用(在option参数中指定):
*CURLOPT_INFILESIZE: 当你上传一个文件到远程站点,这个选项告诉PHP你上传文件的大小。
*CURLOPT_VERBOSE: 如果你想CURL报告每一件意外的事情,设置这个选项为一个非零值。
*CURLOPT_HEADER: 如果你想把一个头包含在输出中,设置这个选项为一个非零值。
*CURLOPT_NOPROGRESS: 如果你不会PHP为CURL传输显示一个进程条,设置这个选项为一个非零值。
注意:PHP自动设置这个选项为非零值,你应该仅仅为了调试的目的来改变这个选项。
*CURLOPT_NOBODY: 如果你不想在输出中包含body部分,设置这个选项为一个非零值。
*CURLOPT_FAILONERROR: 如果你想让PHP在发生错