Using Google

  1. Go to http://www.google.com/cse/ and click on "Create a Custom Search Engine". Note that you will need a Google Account.
    For icyphy, terraswarm, robotics, trust, sec, softwalls and ptolemy, we use the truststc@gmail.com shared account. Mary, Larry and Christopher have the password, or on moog as root, see ~root/.truststcpass.
    For e3s, see E3S Google Webmaster and Analytics Accounts.
    See also How are Google Analytics/Search/Webmaster tools managed?
  2. Click on "Create New Search Engine"
  3. Enter the Name and Description
  4. For Sites to search, use the URL from the htdig configuration
  5. Accept the license and click next
  6. Click next
  7. For frames based sites such as the softwalls site, click "Change look and feel" and select "Google-hosted page". The reason is that part of the terms of service means that the Google results cannot be inside a frame. The solution is to host the site at google.
  8. For frame based pages, insert the code into toc.htm and change
    <form action="http://www.google.com/cse" id="cse-search-box">
    
    to
    <form action="http://www.google.com/cse" id="cse-search-box" target="top">
    
    Also, change the size of the widget from
      <input type="text" name="q" size="31" />
    
    to
      <input type="text" name="q" size="15" />
    
  9. To get search results without advertisements, see How do I create a CSE without ads?.

Updating

In March, 2017, Google wanted us to update to a new version of the Custom Search Engine (CSE) code.

For each of the accounts:

  1. truststc@gmail.com (Mary, Larry and Christopher have the password, or on moog as root, see ~root/.truststcpass).
  2. webadmin@e3s-center.org (see E3S Google Webmaster and Analytics Accounts)

Do the following

  1. Log on to https://cse.google.com
  2. For each site, click on Get Code
  3. Copy the code and paste it to a buffer
  4. Copy the value for cx.
  5. For PhP sites hosted here, find ~www/php/website/layout/html.inc.php, for example ~www/php/e3scenter.org/layout/html.inc.php
  6. Update the value for cx
  7. Update the URL if necessary.
Other sites to check:
  1. https://ptolemy.eecs.berkeley.edu
  2. https://ptolemy.eecs.berkeley.edu/pubs

Old Htdig stuff

The Ptolemy site has a number of search engines that are run by htdig. We want to change them to use Google. To see the search engines, as root on bennett
bennett.EECS.Berkeley.EDU 6# crontab -l | grep htdig | egrep -v "#"

2 2 * * 2,4,5 /bin/csh -c '/usr/local/apache/htdig/bin/rundigpubs -v >& /export/home1/tmp/htdigpubs.out'
4 4 * * * /bin/csh -c '/usr/local/apache/htdig/bin/rundigeecs20 -v >& /export/home1/tmp/htdigeecs20.out'
6 6 * * * /bin/csh -c '/usr/local/apache/htdig/bin/rundigsoftwalls -v >& /export/home1/tmp/htdigsoftwalls.out'
bennett.EECS.Berkeley.EDU 7# 

The lines are search engines for the pubs database, eecs20 and softwalls. The configuration for each search engine is in /usr/local/apache/htdig/conf/. For example, the pubs engine is in /usr/local/apache/htdig/conf/htdigpubs.conf, which contains the line:
start_url:              http://ptolemy.eecs.berkeley.edu/publications
start_url is the URL that we will tell Google to search.