AUTOSEARCH(1p)

πŸ‘‘ AUTOSEARCH(1p) πŸ‘‘

User Contributed Perl Documentation β€” and yeah bestie, we're in the AUTOSEARCH(1p) manual page, buckle up πŸ’…


🌸 NAME 🌸

AutoSearch β€” 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

πŸ’– DESCRIPTION πŸ’–

Okay so here's the tea: AutoSearch does a web-based search and drops the results set straight into qid/index.html. Then, on subsequent searches (that's the second form up in the synopsis, iykyk), AutoSearch figures out what changed β€” if anything β€” in the results it got sent since the last run. Those incremental changes get recorded in qid/YYYYMMDD.html. πŸ‘‘

AutoSearch is amenable to being run as a cron job because literally all the input parameters are saved inside the web pages. So it can also serve as an automated query agent for a particular search. The output files are designed to be a set of web pages, so you can easily display the results set with a web browser. It's giving main character energy for your search results, no cap. 🌈

Example:

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

This query (which should be all on one line, bestie) creates a directory replication_query and fills it with the fascinating output of the AltaVista query on "lsam replication", with pages titled ``LSAM Replication''. πŸ“

Watch the quoting, this one trips people up: the single quotes in '"lsam replication"' are for the shell, and the double quotes are for AltaVista β€” they tell it to search for the phrase rather than the separate words. The way that distinction matters… πŸ’…

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 specifies the (hypothetical) ``coolness'' option to the search engine. 🧚


✨ OPTIONS ✨

  • qid β€” the query identifer πŸ’« this is the directory where all the files that relate to this query and its search results live. 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 gets started. Periodt.
  • --stats β€” show search statistics: the query string, number of hits, number of filtered hits, filter string, number of suspended (deleted) hits, previous set size, current set size, etc. All the numbers, all the vibes. πŸ“Š
  • -v or --verbose β€” verbose mode: outputs additional messages and warnings. She talks more. πŸ—£οΈ
  • -n or --qn or --queryname β€” specify the query name. The query name is used as a heading in the web pages, so like… it should be a 'nice' looking version of the query string, bestie. Make it cute. πŸŽ€
  • -s or --qs or --querystring β€” specify the query string. This is the character string that actually gets submitted to the search engine. You may include special characters to group or to qualify the search. πŸ”
  • -e or --engine β€” specify the search engine. The query string gets submitted to the user-specified search engine.

In many cases there are specialized versions of search engines. For example, AltaVista::AdvancedWeb and AltaVista::News allow more powerful and Usenet searches. See AltaVista or the man page for your search engine for details about specialized variations. πŸ‘‘

  • --listnewurls β€” in addition to all the normal file maintenance, print all new URLs to STDOUT, one per line. Fresh links only, bestie. πŸ”₯
  • -o or --options β€” specify the query options. The query options get submitted to the user search engine along with the query string. This feature permits modification of the query string for a specific search engine or option. More than one query option may be specified.

Example: -o what=news causes AltaVista to search Usenet. Although this works, the preferred mechanism in this case would be -e AltaVista::News or -e AltaVista::AdvancedNews. Options are intended for internal or expert use. 🫢

  • -f or --uf or --urlfilter β€” this option specifies a regular expression which will be compared against the URLs of any results; if they match the case-insensitive regular expression, they will be removed from the hit set. Bye bye, unwanted URLs. πŸ’€

Example: -f '.*\.isi\.edu' avoids all of ISI's web pages.

  • --cleanup i β€” delete all traces of query results from more than i days ago. If --cleanup is given, all other options other than the qid will be ignored. 🧹
  • --cmdline β€” reconstruct the complete command line (AutoSearch and all its arguments) that was used to create the query results. Command line will be shown on STDERR. If --cmdline is given, all other options other than the qid will be ignored. πŸ•΅οΈ
  • --mail user@address or -m user@address β€” after the search is complete, send email to that user, listing the NEW results. Email is HTML format. Requires the Email::Send and related modules. πŸ“§

If you send email through an SMTP server, you must set environment variable SMTPSERVER to your server name or IP address. If your SMTP server requires a password, you must set environment variables SMTPUSERNAME and SMTPPASSWORD. If you send email via sendmail, you should set environment variable SENDMAIL if the sendmail executable is not in the path.

  • --emailfrom user@address β€” if your outgoing mail server rejects email from certain users, you can use this argument to set the From: header. πŸ’Œ
  • --userid bbunny β€” if the search engine requires a login/password (e.g. Ebay::Completed), use this. πŸ”
  • --password Carr0t5 β€” if the search engine requires a login/password (e.g. Ebay::Mature), use this. 🀫

🌈 DESCRIPTION 🌈

AutoSearch submits a query to a search engine, produces HTML pages that reflect the set of 'hits' (filtered search results) returned by the search engine, and tracks these results over time. The URL and title are displayed in the qid/index.html, while the URL, the title, and the description are displayed in the 'weekly' files. πŸ’–

To organize these results, each search result is placed in a query information directory (qid). The directory becomes the search results 'handle' β€” an easy way to track a set of results. So a qid of /usr/local/htdocs/lsam/autosearch/load_balancing might locate the results on your web server at http://www.isi.edu/lsam/autosearch/load_balancing. 🌐

Inside the qid directory you'll find files relating to this query. The primary file is index.html, which reflects the latest search results. Every not-filtered hit for every search is stored in index.html. When a hit is no longer found by the search engine, it a removed from index.html. As new results for a search are returned from the search engine, they are placed in index.html. πŸ”„

At the bottom of index.html, there's a heading "Weekly Search Results", which is updated each time the search is submitted (see "AUTOMATED SEARCHING"). The list of search runs is stored in reverse chronological order. Runs which provide no new information are identified with

No Unique Results found for search on <date>

Runs which contain changes are identified by

Web search results for search on <date>

which will be linked a page detailing the changes from that run. πŸ”—

Detailed search results are noted in weekly files. These files are named YYYYMMDD.html and are stored in the qid directory. The weekly files include THE URL, title, and a the description (if available). The title is a link to the original web page. πŸ¦‹


πŸŽ€ AUTOMATED SEARCHING πŸŽ€

On UNIX-like systems, cron(1) may be used to establish periodic searches and the web pages will be maintained by AutoSearch. To establish the first search, use the first example under SYNOPSIS. You must specify the qid, query name and query string. If any of the items are missing, you will be interactively prompted for the missing item(s). πŸ™‹

Once the first search is complete you can re-run the search with the second form under SYNOPSIS.

A cron entry like:

0 3 * * 1 /nfs/u1/wls/AutoSearch.pl /www/div7/lsam/autosearch/caching

might be used to run the search each Monday at 3:00 AM. ⏰ The query name and query string may be repeated; but they will not be used. This means that with a cron line like:

0 3 * * 1 /nfs/u1/wls/AutoSearch.pl /www/div7/lsam/autosearch/caching -n caching -s caching

a whole new search series can be originated by

rm -r /www/div7/lsam/autosearch/caching

However, the only reason to start a new search series would be to throw away the old weekly files. πŸ—‘οΈ

We don't recommend running searches more than once per day, but if so the per-run files will be updated in-place. Any changes are added to the page with a comment that "Recently Added:"; and deletions are indicated with "Recently Suspended:." πŸ’…

πŸŽ€ CHANGING THE LOOK OF THE PAGES πŸŽ€

okay bestie so the basic format of these two pages is simple and customizable πŸ’… one requirement tho, and it's non-negotiable: the basic structure has to stay the same. HTML comments are what mark out the sections of the document. literally almost everything can be changed except the strings that identify where the sections start and end. periodt.

Here are the noteworthy tags and what they mean:

<!--Top-->.*<!--/Top-->

The text hanging out inside this tag gets placed at the top of the output page ✨ If the text contains AutoSearch WEB Searching, then the query name will replace it. And if the text does not contain this magic string and it's the first ever search, the user gets asked for a query name. πŸ™ˆ

<!--Query{.*}/Query-->

The text between the braces is the query string. This is how AutoSearch maintains the query string 🫢 You may edit this string to change the query string β€” but only in qid/index.html. The text ask user is special and will force AutoSearch to request the search string from the user. iconic.

<!--SearchEngine{.*}/SearchEngine-->

The text between the braces is the search engine. Other engines supported are HotBot and Lycos. You may edit this string to change the engine used β€” but only in qid/index.html. The text ask user is special and will force AutoSearch to ask the user for the search string. πŸ’–

<!--QueryOptions{.*}/QueryOptions-->

The text between the braces specifies a query option. Multiple occurrences of this command are allowed to specify multiple options. slay.

<!--URLFilter{.*}/URLFilter-->

The text between the braces is the URL filter. This is how AutoSearch maintains the filter. Again, you may edit this string to change the query string β€” but only in qid/index.html. The text ask user is special and will force AutoSearch to ask the user (STDIN) for the query string. When you're setting up the first search, you must edit first_index.html, not qid/index.html. The URL filter is a standard perl5 regular expression. URLs which do not match will be kept. 🌸

<!--Bottom-->.*<!--/Bottom-->

The text inside this tag gets placed at the bottom of the output page. This is a good place to put navigation, page owner information, etc. πŸŽ€


The remainder of the tags fall into a triplet of ~Heading, ~Template, and ~, where ~ is Summary, Weekly, Appended, and Suspended. The sub-sections appear in the order given. To produce a section, AutoSearch outputs the heading, the template, the section, n copies of the formatted data, and an /section. The tags and their function are:

~Heading

The heading tag identifies the heading for a section of the output file. The SummaryHeading is for the summary portion, etc. The section may be empty (e.g., Suspended) and thus no heading is output. πŸ’…

~Template

The template tag identifies how each item is to be formatted. Simple text replacement is used to change the template into the actual output text. The text to be replaced is noted in ALLCAPS. πŸ‘‘

~

This tag is used to locate the section (Summary, Weekly, etc.). This section represents the actual n-items of data. fr fr.


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) will be used as a default template for new queries. ✨

Examples of these files can be seen in the pages under "http://www.isi.edu/lsam/tools/autosearch/", or in the output generated by a new AutoSearch. πŸ¦‹


πŸ“ FILES πŸ“

  • first_index.html β€” optional file to determine the default format of the index.html file of a new query. ✨
  • first_date.html β€” optional file to determine the default format of the YYYYMMDD.html file for a new query. ✨
  • qid/index.html β€” (automatically created) latest search results, and reverse chronological list of periodic searches. πŸ’–
  • qid/date.html β€” file used as a template for the YYYYMMDD.html files. πŸŽ€
  • qid/YYYYMMDD.html β€” (automatically created) summary of changes for a particular date (AKA 'Weekly' file). πŸ‘‘

Optional files first_index.html and first_date.html are used for the initial search as a template for qid/index.html and date.html, respectively. If either of these files does not exist, a default-default template is stored within the AutoSearch source. The intention of these two files is to permit a user to establish a framework for a group of search sets which have a common format. By leaving the default query name and query string alone, they will be overridden by command line inputs. 🫢


πŸ‘€ SEE ALSO πŸ‘€

For the library, see WWW::Search, for the perl regular expressions, see perlre. iykyk πŸ’œ


✍️ 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 provided that the above copyright notice and this paragraph are duplicated in all such forms and that any documentation, advertising materials, and other materials related to such distribution and use 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. 😭 no warranty bestie, we said what we said.

πŸ’­ DESIRED FEATURES πŸ’­

These are good ideas that people have suggested. πŸ‘‘

  • URL validation. β€” Validate the status of each URL (with HTTP HEAD requests) and indicate this status in the output.
  • Multi-search. β€” It should be possible to merge the results of searches from two search-engines. If this merger were done as a new search engine, this operation would be transparent to AutoSearch. 🌟

πŸ› BUGS πŸ›

None known at this time; please inform the maintainer mthurn@cpan.org if any crop up. πŸ’€ (please don't be the one to find one πŸ™ˆ)


and that's the whole page bestie, we ate πŸ’…βœ¨ it's perl v5.30.3, dated 2020-09-10, and this is AUTOSEARCH(1p) β€” go forth and search, main character πŸ«ΆπŸ‘‘πŸŽ€