Get gpmnum

From TheGPMWiki
Jump to: navigation, search

Summary

The get_gpmnum.pl script allows for the bulk return of GPM file numbers based on a keyword search of the notes included with the dataset at the time of submittal to The GPM. The results of the search are a delimited list of GPM numbers, suitable for use in automation or importing into external programs.

Technical Details

The get_gpmnum.pl script takes two arguments, one required and one optional. They can be defined either through an HTTP POST or the GET string.

  • k (required): the keyword with which to search the notes.
  • s (optional): a separator to use for the results of the search. If this parameter is not defined in the query, a single comma without spacing (,) is used to separate the list of GPM numbers.

If the search yields no results, a blank HTML document will be returned, with nothing inside the <body> tags. If the keyword parameter is undefined or blank, the response will read "ERROR_NO_KEYWORD_SUPPLIED".

Examples

To search for any GPM file which includes the word Michigan in the notes, the search would be: http://gpmdb.thegpm.org/thegpm-cgi/get_gpmnum.pl?k=Michigan.

To search for any GPM file which includes the word Michigan, but is separated with HTML breaks, the search would be: http://gpmdb.thegpm.org/thegpm-cgi/get_gpmnum.pl?k=Michigan&s=<br>.

Personal tools