GoogleAPI

The GoogleAPI application offers ways to run Google queries and save results. This makes it easy to collect relevant links and to focus on the most recent pages (especially if the query topic is one which is very busy).

Installation and Configuration

Get the Google API download from the Google site (you need a licence key, which is free – the rest of the download may or may not be interesting to you).

Given a working Dyalog APL (Version 10 or higher) copy the following files into a folder for the GoogleAPI application

GoogleAPI.dws

The GoogleAPI workspace

GoogleSearchService.dll

The DLL required for interfacing APL/W and the Google API

doggoog.bmp

Bitmap file used in the Help/About form

Googicon.ico

Icon file used for the main form

googhot.bmp goognorm.bmp googoff.bmp

Bitmap files used for toolbar images

google.dcf

Contains configuration details and saved results, a blank file in the correct format is available from Dogon Research Ltd.

It is an APL component file with the structure:

doggoog.bmp

Component

Purpose

Structure

1

General file description

Character vector

2

Component description

Character matrix

3

Free component list

Numeric vector

4

Query date/count

Two-element numeric vector

Date (y m d)

Query count

5

Google API Licence key

Character vector

11

Query Index

Self-description (character matrix)

Three-column matrix of query info:

Phrase

Last Queried (date)

Results component

12

ToDo table (developer use)

Self-description

Three-column matrix of todo items:

Description

Date (as IDN)

Comment

21 onward

Query results

Nine-column matrix of query results (one row per query). Columns are as described in the Google documentation



Into a subfolder called Help, copy

googleapi.html

This help file (Help uses your default Web browser for display)



Create a desktop shortcut to start the application, with the properties:

dyalog.exe googleapi homefolder=name of the folder containing the files described above

Startin: name of the folder containing the files described above

Use the googicon.ico file if you like.

The first time the application is run you will be prompted for your Google key

Using GoogleAPI






MenuBar

File Menu

Save

Save the selected links

Count

Get Google's approximate page count for the current query (shown in the status bar)

Go

Run the current query (retrieves the first ten result pages)

Exit

Close down the application

Edit Menu

Edit

Opens a simple dialogue box which allows you to edit the current query phrase (so that a phrase can be refined while old query results are kept).

Today

Sets the “from” date to today, so that query parameters can be saved without running a query (useful in the case of frequently-changing query results arising from popular query phrases).

Help Menu

Help

Show this help

ToDo

Display (and allow editing of) the current to-do list.

About

Displays an “about” page.

ToolBar

Save

Save the selected links.

Exit

Close down the application.

Count

Get Google's approximate page count for the current query (shown in the status bar).

Run Query

Run the current query (retrieves the first ten result pages)

Retrieve Next

Retrieve the next ten pages from Google.

Retrieve All

Retrieve all remaining query pages (the retrieval process can be cancelled at any time by clicking the Cancel button).

Cancel

Only enabled while “retrieve all” is running – checking the box will terminate the retrieval.

Delete

Delete the current query phrase (and all associated saved results)

Modify

Opens a simple dialogue box which allows you to edit the current query phrase (so that a phrase can be refined while old query results are kept).

Query Bar

Phrase Combo

Contents are a list of Google query phrases. Select an existing phrase by clicking on it, add new phrases by typing into the edit area.

When an existing phrase is selected the saved results (and last query date) are retrieved and displayed on the form.

When a new phrase is entered the form is reset (and the From date is set 100 days back).

From Date

Google indexing activity from this date is retrieved when the query is run.

To Date

Google indexing activity up to this date is retrieved when the query is run.

Results Grid

Displays URL and snippet from Google; a popup menu is available by right-clicking on any row and offers:

Detail

Shows a popup form with all Google fields (URL, Summary, Snippet, Title, Cached Size, Related Info, Hostname, Directory Name, Directory Title

View

Opens a browser at the selected URL

Transfer

Transfer this entry onto the Stored Results grid (not available if the URL is already present as a stored result)

Erase

Erase the row

Transfer All

Transfer all rows to the Stored Results grid (only unique URLs are transferred)

Cancel

Close the popup menu without taking any action

Stored Results Grid

The same format as the Results grid, but populated by previously-saved query results; it is the content of this grid which is saved when you use the Save options.

The popup menu is similar, but does not offer a Transfer option (there is an Erase All option, allowing you to clear stored results).

Status Bar

Query Count

The accumulated number of queries run today (Google imposes a limit of 1000 queries per day through the API interface)

Page Count

The approximate number of pages matching the query.

Fetch Count

Pages fetched for this query.

Acknowledgements

The GoogleSearchService.dll file was created by Stefano Lanzavecchia of APL Italia.

“Google Hacks” by Tara Calishan and Rael Dornfest (O'Reilly ISBN 0-596-0047-8) contains a useful expansion of the Google documentation.

Copyright © Dogon Research Ltd., 2003-4