1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="HTTrack is an easy-to-use website mirror utility. It allows you to download a World Wide website from the Internet to a local directory,building recursively all structures, getting html, images, and other files from the server to your computer. Links are rebuiltrelatively so that you can freely browse to the local site (works with any browser). You can mirror several sites together so that you can jump from one toanother. You can, also, update an existing mirror site, or resume an interrupted download. The robot is fully configurable, with an integrated help" />
<meta name="keywords" content="httrack, HTTRACK, HTTrack, winhttrack, WINHTTRACK, WinHTTrack, offline browser, web mirror utility, aspirateur web, surf offline, web capture, www mirror utility, browse offline, local site builder, website mirroring, aspirateur www, internet grabber, capture de site web, internet tool, hors connexion, unix, dos, windows 95, windows 98, solaris, ibm580, AIX 4.0, HTS, HTGet, web aspirator, web aspirateur, libre, GPL, GNU, free software" />
<title>HTTrack Website Copier - Offline Browser</title>
<link rel="stylesheet" href="httrack.css" type="text/css" />
</head>
<table width="76%" border="0" align="center" cellspacing="0" cellpadding="0" class="tableWidth">
<tr>
<td><img src="images/header_title_4.png" width="573" height="34" alt="HTTrack Website Copier" title="" border="0" id="title" /></td>
</tr>
</table>
<table width="76%" border="0" align="center" cellspacing="0" cellpadding="3" class="tableWidth">
<tr>
<td id="subTitle">Open Source offline browser</td>
</tr>
</table>
<table width="76%" border="0" align="center" cellspacing="0" cellpadding="0" class="tableWidth">
<tr class="blak">
<td>
<table width="100%" border="0" align="center" cellspacing="1" cellpadding="0">
<tr>
<td colspan="6">
<table width="100%" border="0" align="center" cellspacing="0" cellpadding="10">
<tr>
<td id="pageContent">
<!-- ==================== End prologue ==================== -->
<h2 align="center"><em>HTTrack Programming page - scripting</em></h2>
<br>
We will see here several examples, written in batch script (can be adapted to almost all batch script languages) or in C.
<br><br>
<br><br>
<table width="100%" border="0" background="img/fade.png">
<tr><td>
<b>How to get one single file</b><br><br>
<tt>
httrack --get http://localhost/
</tt>
</td></tr>
</table>
<br><br>
<table width="100%" border="0" background="img/fade.png">
<tr><td>
<b>How to get one single file and pipe it to stdout</b><br><br>
<tt>
httrack --quiet --get http://localhost/ -O tmpget -V "cat \$0" | grep -iE "TITLE"
rm -rf tmpget
</tt>
</td></tr>
</table>
<br><br>
<table width="100%" border="0" background="img/fade.png">
<tr><td>
<b>How to search in all HTML files on a website</b><br><br>
<tt>
httrack --skeleton http://localhost/ -V "if grep -iE \"TITLE\" \"\$0\">/dev/null; then echo \"Match found at \$0\"; fi"<br>
rm -rf tmpget<br>
</tt>
<br>Same thing but matches only the first file:<br>
<tt>
httrack --skeleton http://localhost/ -V "if grep -iE \"TITLE\" \"\$0\">/dev/null; then echo \"Match found at \$0\"; kill -9 \$PPID; fi"<br>
rm -rf tmpget<br>
</tt>
</td></tr>
</table>
<br><br>
<table width="100%" border="0" background="img/fade.png">
<tr><td>
<b>Indexing a website, and using the index as a search engine</b><br><br>
<tt>httrack localhost -%I</tt><br>
Will generate an index.txt file, which contains all detected keywords, sorted and indexed using this format:<br>
<br>
<table border="0" bgcolor="white"><tr><td>
<i>keyword</i><br>
<tab> <i>number_of_hits_in_current_page_for_this_keyword</i> <i>page_location</i><br>
<tab> <i>number_of_hits_in_current_page_for_this_keyword</i> <i>page_location</i><br>
<tab> <i>number_of_hits_in_current_page_for_this_keyword</i> <i>page_location</i><br>
...<br>
=<i>total_number_of_hits_for_this_keyword</i><br>
(<i>(total_number_of_hits_for_this_keyword*1000)/total_number_of_keywords</i>)<br>
</td></tr></table>
<br>
Example:
<table border="0" bgcolor="white"><tr><td>
<pre>
abilities
1 localhost/manual/mod/index-2.html
1 localhost/manual/mod/index.html
1 localhost/manual/mod/mod_negotiation.html
=3
(0)
ability
2 localhost/manual/misc/FAQ.html
2 localhost/manual/suexec.html
1 localhost/manual/handler.html
1 localhost/manual/misc/security_tips.html
1 localhost/manual/mod/mod_rewrite.html
1 localhost/manual/mod/mod_setenvif.html
1 localhost/manual/multilogs.html
1 localhost/manual/netware.html
1 localhost/manual/new_features_1_3.html
1 localhost/manual/windows.html
=12
(0)
able
4 localhost/manual/dso.html
4 localhost/manual/mod/core.html
3 localhost/manual/dns-caveats.html
3 localhost/manual/mod/mod_auth.html
3 localhost/manual/mod/mod_rewrite.html
3 localhost/manual/upgrading_to_1_3.html
2 localhost/manual/misc/API.html
2 localhost/manual/misc/FAQ.html
2 localhost/manual/misc/windoz_keepalive.html
2 localhost/manual/mod/mod_auth_db.html
2 localhost/manual/mod/mod_auth_dbm.html
1 localhost/manual/misc/descriptors.html
1 localhost/manual/misc/fin_wait_2.html
1 localhost/manual/misc/security_tips.html
1 localhost/manual/mod/mod_auth_digest.html
1 localhost/manual/mod/mod_cern_meta.html
1 localhost/manual/mod/mod_env.html
1 localhost/manual/mod/mod_example.html
1 localhost/manual/mod/mod_unique_id.html
1 localhost/manual/mod/mod_usertrack.html
1 localhost/manual/stopping.html
1 localhost/manual/suexec.html
1 localhost/manual/vhosts/ip-based.html
1 localhost/manual/windows.html
=43
(0)
</pre>
...
</td></tr></table>
<br>
Script example:
<a href="div/search.sh">search.sh</a>
</td></tr>
</table>
<br><br>
<!-- ==================== Start epilogue ==================== -->
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="76%" border="0" align="center" valign="bottom" cellspacing="0" cellpadding="0">
<tr>
<td id="footer"><small>© 2007 Xavier Roche & other contributors - Web Design: Leto Kauler.</small></td>
</tr>
</table>
</body>
</html>
|