Here's a simple script to generate a boilerplate FOIA-letter type thing that I cobbled together...

Published 2013-01-29

This is a super simple shell script that takes boilerplate FOIA language and creates a markdown file that can be addressed to a particular agency.

It's tailored to California, but you can adjust it to your liking.

You will still have to add the address, city, state and zip code of the agency, and the type of data being requested, but this is a step up from having a file that I copy and paste from.

The script takes a filename as an argument. That filename will have the date prepended to it so you can see at a glance which were sent out when.

I haven't decided yet to allow for the address and other potential variables to be passed into the script. At certain points you want to allow for mistakes, and most folks are bound to make mistakes when entering information in on the command line.

#!/bin/bash

    # date variable
    DATE="$(date +"%m-%d-%y")"

    # input for newfile
    NAME_OF_FOIA_LETTER="$1"

    # name for newfile
    OUTPUT_FILE="$DATE-$NAME_OF_FOIA_LETTER.md"

    # create markdown FOIA
    echo "Creating $NAME_OF_FOIA_LETTER FOIA letter"
    cat <<EOF >$OUTPUT_FILE
    **$DATE**

    ADDRESS  $line
    STREET  $line
    CITY, STATE, ZIP CODE  $line

    **RE**: Public records request for NAME OF RECORD

    **To Whom It May Concern**:

    Under the California Public Records Act (Government Code Section 6250 et seq.), I ask to obtain a copy of the following records or data sets which I understand to be held by your agency:

    >*DATA TO BE REQUESTED HERE*

    I ask for a determination on this request within 10 days of receipt, or sooner should you make a determination without review of the record(s) in question.

    If you determine that any or all or the information if exempt, I would like to know if the exemption is discretionary, if it's necessary to exercise discretion in this case and a signed notification citing the legal authorities used to determine the records are exempt.

    Should some -- but not all of the information -- be exempt from disclosure -- and you intend to withhold it -- I ask that you redact it for the time being and make the rest available as requested.

    Please notify me of any duplication costs that will exceed \$10.00. If I can provide any clarification or answer any questions, my contact information is below.

    Thanks in advance and take care.

    Sincerely:

    Chris Keller  $line
    Data Journalist/News Applications Developer  $line
    Southern California Public Radio  $line
    **Web**: scpr.org  $line
    **Email**: ckeller@scpr.org  $line
    **Desk**: (626) 583-5214  $line

    EOF

    open $OUTPUT_FILE