mirror of
https://github.com/xroche/httrack.git
synced 2026-08-05 07:15:59 +03:00
* The masthead wordmark is a 400x34 GIF that blurs on any hi-DPI screen Replaces it with an outlined SVG across the 38 documentation and WebHTTrack pages that carry it. The original was set in Futura, so the lockup was refitted in Jost*, the closest free Futura revival, taking weight from the measured stem thickness, size from the cap heights and tracking by least squares against the glyph positions in the old bitmap. tests/82 now asserts that every image a GUI page names is actually served. Signed-off-by: Xavier Roche <xroche@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com> * Point the shared chrome generator at the new wordmark The masthead of the 13 generated pages comes from tools/doc-chrome.py, so editing the pages alone left the generator disagreeing with its own output and --check red. Signed-off-by: Xavier Roche <xroche@gmail.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com> --------- Signed-off-by: Xavier Roche <xroche@gmail.com> Signed-off-by: Xavier Roche <roche@httrack.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
207 lines
5.6 KiB
HTML
207 lines
5.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<!-- doc-chrome:head -->
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta name="description" content="Driving the httrack command-line program from shell and batch scripts.">
|
|
<link rel="stylesheet" href="doc.css">
|
|
<script src="doc.js" defer></script>
|
|
<!-- /doc-chrome:head -->
|
|
<title>Scripting HTTrack</title>
|
|
</head>
|
|
<body>
|
|
|
|
<!-- doc-chrome:top -->
|
|
<a class="skip" href="#main">Skip to content</a>
|
|
|
|
<header class="masthead">
|
|
<img src="images/wordmark.svg" width="400" height="36" alt="HTTrack Website Copier">
|
|
<div class="tagline">Open Source offline browser</div>
|
|
</header>
|
|
|
|
<div class="wrap">
|
|
|
|
<nav class="toc" aria-label="Documentation">
|
|
<h2>Start here</h2>
|
|
<ul>
|
|
<li><a href="guide.html">Interface guide</a></li>
|
|
<li><a href="faq.html">FAQ and troubleshooting</a></li>
|
|
<li><a href="abuse.html">Using HTTrack responsibly</a></li>
|
|
</ul>
|
|
<h2>Command line</h2>
|
|
<ul>
|
|
<li><a href="cmdguide.html">Command-line guide</a></li>
|
|
<li><a href="httrack.man.html">Option reference</a></li>
|
|
<li><a href="filters.html">Filter syntax</a></li>
|
|
</ul>
|
|
<h2>Developers</h2>
|
|
<ul>
|
|
<li><a href="dev.html">Programming</a></li>
|
|
<li><a href="library.html">libhttrack API</a></li>
|
|
<li><a href="plug.html">Callbacks</a></li>
|
|
<li><a href="scripting.html" aria-current="page" class="here">Scripting</a></li>
|
|
<li><a href="cache.html">Cache format</a></li>
|
|
<li><a href="changes.html">Change report format</a></li>
|
|
</ul>
|
|
<h2>More</h2>
|
|
<ul>
|
|
<li><a href="fcguide.html">Users Guide (3.10)</a></li>
|
|
<li><a href="contact.html">Contact and credits</a></li>
|
|
<li><a href="index.html">All documentation</a></li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<main id="main">
|
|
<!-- /doc-chrome:top -->
|
|
|
|
<h1>HTTrack Programming page - scripting</h1>
|
|
|
|
<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.gif">
|
|
<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.gif">
|
|
<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.gif">
|
|
<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.gif">
|
|
|
|
<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>
|
|
|
|
<!-- doc-chrome:bottom -->
|
|
</main>
|
|
</div>
|
|
|
|
<dialog id="zoom" aria-label="Enlarged image"><img src="" alt=""></dialog>
|
|
|
|
<footer>© 1998-2026 Xavier Roche & other contributors - Web Design: Leto Kauler.</footer>
|
|
<!-- /doc-chrome:bottom -->
|
|
|
|
</body>
|
|
</html>
|