AUTOSEARCH(1)

๐Ÿ“ฆ
version 2.519 ยท 2 versions
, in fedora 43

๐Ÿฆ‹ AUTOSEARCH(1) ๐Ÿฆ‹

Part 1 of 2 ๐Ÿ’– Okay bestie, this is the User Contributed Perl Documentation manual page, and it's LONG, so we're splitting it up. Here's part one โœจ


โœจ NAME โœจ

AutoSearch is a web-search tracking application ๐Ÿ”ฅ

๐ŸŽ€ SYNOPSIS ๐ŸŽ€

AutoSearch [--stats] [--verbose] -n "Query Name" -s "query string"
--engine engine [--mail you@where.com] [--options "opt=val"]...
[--filter "filter"] [--host host] [--port port] [--userid bbunny
--password c4rr0t5] [--ignore_channels KABC,KCBS,KNBC] qid

AutoSearch --VERSION AutoSearch --help AutoSearch --man

Okay that's a lot of flags ๐Ÿ˜ญ but it's all in the lineup above, so no stress ๐Ÿ’…

๐ŸŒˆ DESCRIPTION ๐ŸŒˆ

AutoSearch runs a web-based search and dumps the results into qid/index.html ๐Ÿ’… Later runs (that's the second form up in the SYNOPSIS) figure out what changed since the last time, and those changes get recorded in qid/YYYYMMDD.html โœจ

AutoSearch is cron-job friendly because all the input parameters get saved in the web pages ๐Ÿงš So it basically works as an automated query agent for one particular search. The output files are a set of web pages you can view in a browser, so your results look cute ๐Ÿ“

๐ŸŒธ Example

AutoSearch -n 'LSAM Replication'
    -s '"lsam replication"'
    -e AltaVista
    replication_query

Heads up, that whole thing should be on one line ๐Ÿ™ˆ It makes a replication_query directory and fills it with AltaVista's results for "lsam replication", with pages titled "LSAM Replication" ๐Ÿฆ‹ Quick quoting tea: the single quotes around '"lsam replication"' are for the shell, and the double quotes tell AltaVista to search for the whole phrase instead of the separate words. Iconic ๐Ÿ’œ

๐Ÿ’… A more complicated example

AutoSearch -n 'External Links to LSAM'
    -s '(link:www.isi.edu/lsam or link:www.isi.edu/~lsam) -url:isi.edu'
    -e AltaVista::AdvancedWeb
    -o coolness=hot

This one does an advanced AltaVista search and passes along the (hypothetical) coolness option to the search engine. Main character energy ๐Ÿ‘‘


โœจ OPTIONS โœจ

  • qid โ€” this is the query identifier, and it's the directory where every file for this query and its results lives ๐Ÿ—‚๏ธ It can be an absolute path or a relative path from cwd. If the directory doesn't exist yet, it gets created and a brand new search starts ๐ŸŒฑ
  • --stats โ€” shows the search stats: the query string, number of hits, number of filtered hits, filter string, number of suspended (deleted) hits, previous set size, current set size, and more ๐Ÿ“Š
  • -v, --verbose โ€” extra chatty mode ๐Ÿ—ฃ๏ธ You get additional messages and warnings
  • -n, --qn, --queryname โ€” sets the query name ๐Ÿท๏ธ It's used as the heading on your web pages, so make it a nice-looking version of your query string โœจ
  • -s, --qs, --querystring โ€” sets the query string ๐Ÿ” This is the exact text sent to the search engine, and you can add special characters to group or qualify your search ๐Ÿ’–
  • -e, --engine โ€” picks the search engine ๐ŸŽฏ Your query string gets submitted to the one you name. Lots of engines have specialized versions, like AltaVista::AdvancedWeb and AltaVista::News, which unlock more powerful searches and Usenet searches ๐Ÿง  For the deets on those variations, check out AltaVista or the man page for your search engine
  • --listnewurls โ€” along with all the normal file maintenance, prints every new URL to STDOUT, one per line ๐Ÿฆ‹
  • -o, --options โ€” sends query options to the search engine alongside the query string ๐ŸŽ›๏ธ This lets you tweak the query for a specific engine or option, and you can use more than one. For example, -o what=news makes AltaVista search Usenet. It works, but the preferred move is -e AltaVista::News or -e AltaVista::AdvancedNews. Options are meant for internal or expert use, bestie ๐Ÿง‘โ€๐Ÿ’ป
  • -f, --uf, --urlfilter โ€” a regular expression that gets compared against the URLs of your results ๐Ÿšซ If one matches (case-insensitive), it's removed from the hit set. For example, -f '.*\.isi\.edu' avoids all of ISI's web pages ๐Ÿ™…โ€โ™€๏ธ
  • --cleanup i โ€” deletes all traces of query results from more than i days ago ๐Ÿงน If --cleanup is given, every other option except the qid gets ignored ๐Ÿ’€
  • --cmdline โ€” rebuilds the complete command line (AutoSearch and all its arguments) that was used to create the query results ๐Ÿงพ The command line gets shown on STDERR. If --cmdline is given, every other option except the qid gets ignored ๐Ÿ™ˆ
  • --mail user@address, -m user@address โ€” after the search finishes, emails that user the NEW results in HTML format ๐Ÿ’Œ This requires the Email::Send and related modules. If you send through an SMTP server, set the environment variable SMTPSERVER to your server name or IP address ๐ŸŒ If your SMTP server needs a password, set the environment variables SMTPUSERNAME and SMTPPASSWORD ๐Ÿ” If you send via sendmail, set the environment variable SENDMAIL when the sendmail executable isn't in the path ๐Ÿ“ฎ
  • --emailfrom user@address โ€” if your outgoing mail server is being picky and rejects email from certain users, use this to set the From: header ๐Ÿ’…
  • --userid bbunny โ€” if the search engine needs a login and password (like Ebay::Completed), use this ๐Ÿชช
  • --password Carr0t5 โ€” if the search engine needs a login and password (like Ebay::Mature), use this ๐Ÿ”‘

โœจ CHANGING THE LOOK OF THE PAGES โœจ

okay bestie, the basic format of these two pages is super simple AND customizable ๐Ÿ’… the one big rule is that the basic structure has to stay exactly the same ๐Ÿ˜ญ HTML comments are how it finds each section of the doc. You can change almost everything, except the strings that mark where sections start and end ๐Ÿซถ

Here are the noteworthy tags and what they do ๐ŸŽ€

  • <!--Top-->.*<!--/Top--> โ€” whatever text lives inside this tag gets placed at the very top of the output page ๐Ÿ” If the text includes the magic phrase AutoSearch WEB Searching, the query name swaps in to replace it. If there's no magic phrase and it's the very first search ever, AutoSearch will ask the user for a query name ๐Ÿ™‹โ€โ™€๏ธ
  • <!--Query{.*}/Query--> โ€” the text between the braces is the query string ๐Ÿ” This is how AutoSearch keeps track of it. You can change it, but ONLY in qid/index.html ๐Ÿšซ The text ask user is special and forces AutoSearch to request the search string from the user ๐ŸŽค
  • <!--SearchEngine{.*}/SearchEngine--> โ€” the text between the braces is the search engine ๐ŸŒ The other engines it supports are HotBot and Lycos ๐ŸŒธ You can edit it to change the engine, but ONLY in qid/index.html. The text ask user is special here too, and forces AutoSearch to request the search string from the user ๐Ÿ™‹
  • <!--QueryOptions{.*}/QueryOptions--> โ€” the text between the braces specifies a query option โœจ You can use this tag multiple times to set multiple options ๐Ÿซง
  • <!--URLFilter{.*}/URLFilter--> โ€” the text between the braces is the URL filter ๐Ÿงน This is how AutoSearch maintains the filter. You can edit it, but ONLY in qid/index.html ๐Ÿšซ The text ask user is special and forces AutoSearch to ask the user (STDIN) for the query string ๐ŸŽค When setting up the very first search, you have to edit first_index.html, NOT qid/index.html ๐Ÿ›‘ The URL filter is a standard perl5 regular expression ๐Ÿง  URLs that don't match get KEPT ๐Ÿ’–
  • <!--Bottom-->.*<!--/Bottom--> โ€” the text inside this tag goes at the very bottom of the output page ๐Ÿ‘‡ It's a great spot for navigation, page owner info, etc. ๐Ÿงญ

The rest of the tags come in a trio: ~Heading, ~Template, and ~, where ~ is Summary, Weekly, Appended, or Suspended ๐Ÿฆ‹ The sub-sections show up in the order given. To make a section, AutoSearch outputs the heading, then the template, then the section itself, then n copies of the formatted data, then a /section closer. Here's what each tag does:

  • ~Heading โ€” identifies the heading for a section of the output file. So SummaryHeading is for the summary part, and so on. A section can be empty (like Suspended), and in that case no heading gets output ๐Ÿซฅ
  • ~Template โ€” defines how each item gets formatted. It's simple text replacement that turns the template into the real output text. The text to be replaced is written in ALLCAPS ๐Ÿ” 
  • ~ โ€” locates the section (Summary, Weekly, etc.). This is where the actual n items of data live ๐Ÿ“ฆ

You can edit these values in the qid/index.html page of an existing search ๐Ÿ’ป The file first_index.html (in the directory above qid) is used as a default template for new queries ๐ŸŒฑ

Examples of these files can be seen under http://www.isi.edu/lsam/tools/autosearch/, or in the output generated by a brand-new AutoSearch ๐Ÿ‘€


๐Ÿ“ FILES ๐Ÿ“

  • first_index.html โ€” optional file that sets the default format of the index.html file for a new query ๐ŸŒท
  • first_date.html โ€” optional file that sets the default format of the YYYYMMDD.html file for a new query ๐ŸŒท
  • qid/index.html โ€” (automatically created) the latest search results, plus a reverse chronological list of periodic searches ๐Ÿ“œ
  • qid/date.html โ€” file used as a template for the YYYYMMDD.html files ๐Ÿง
  • qid/YYYYMMDD.html โ€” (automatically created) a summary of changes for a particular date, AKA the 'Weekly' file ๐Ÿ“…

The optional files first_index.html and first_date.html are used for the initial search as templates for qid/index.html and date.html, respectively. If either of these files doesn't exist, a default-default template is stored within the AutoSearch source ๐Ÿซ  The whole point is to let a user set up a framework for a group of search sets that share a common format ๐Ÿ’œ By leaving the default query name and query string alone, they'll be overridden by command line inputs ๐Ÿ–ฅ๏ธ


๐Ÿ‘ฏ SEE ALSO ๐Ÿ‘ฏ

For the library, see WWW::Search. For the perl regular expressions, see perlre. ๐Ÿง 


โœ๏ธ AUTHORS โœ๏ธ

Wm. L. Scheding ๐Ÿ–Š๏ธ

AutoSearch is a re-implementation of an earlier version written by Kedar Jog ๐Ÿซถ


Copyright (C) 1996-1997 University of Southern California. All rights reserved. ๐Ÿ›๏ธ

Redistribution and use in source and binary forms are permitted, as long as the above copyright notice and this paragraph are duplicated in all such forms. Any documentation, advertising materials, and other materials related to that distribution and use have to acknowledge that the software was developed by the University of Southern California, Information Sciences Institute. The name of the University may not be used to endorse or promote products derived from this software without specific prior written permission ๐Ÿ“œ

THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ๐Ÿšจ

๐Ÿ’ก DESIRED FEATURES ๐Ÿ’ก

These are good ideas that people have suggested ๐Ÿง 

URL validation.

Validate the status of each URL (with HTTP HEAD requests) and indicate that status in the output ๐Ÿ”

It should be possible to merge the results of searches from two search engines. If this merger were done as a new search engine, the operation would be transparent to AutoSearch ๐Ÿฆ‹


๐Ÿ› BUGS ๐Ÿ›

None known at this time ๐Ÿ™ˆ If any crop up, please let the maintainer know at mthurn@cpan.org ๐Ÿ’Œ


That's the whole page, bestie ๐ŸŒˆ This one comes from perl v5.42.0, dated 2025-07-25, and it's AUTOSEARCH(1) ๐Ÿ’– slay forever ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from