<commit_before><?php

    $ctm_api_base = 'http://civic-tech-movement.codeforamerica.org/api';
    $brigades_url = "{$ctm_api_base}/organizations.geojson";
    $geojson = json_decode(file_get_contents($brigades_url), true);
    
    if(!function_exists('h'))
    {
        function h($s) 
        {
            return htmlspecialchars($s);
        }
    }

    $base_url = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/');
    
?>
<ul id="brigades-list" style="display: none">
    <? foreach($geojson['features'] as $feature) { ?>
        <li data-lat="<?= h($feature['geometry']['coordinates'][1]) ?>"
            data-lon="<?= h($feature['geometry']['coordinates'][0]) ?>" >
            <a href="<?= $base_url.'/brigade.php/'.rawurlencode($feature['properties']['name']) ?>"><?= h($feature['properties']['name']) ?></a>
        </li>
    <? } ?>
</ul>
<commit_msg>Added old brigade numeric IDs<commit_after><?php

    //
    // We're looking for numeric IDs from the old site for the Join form.
    // To do: don't do this.
    //
    $old_brigades_url = 'http://brigade.codeforamerica.org/brigades.json';
    $old_brigades = json_decode(file_get_contents($old_brigades_url), true);
    
    $brigade_ids = array();
    
    foreach($old_brigades as $old)
    {
        $brigade_ids[$old['name']] = $old['id'];
    }

    $ctm_api_base = 'http://civic-tech-movement.codeforamerica.org/api';
    $brigades_url = "{$ctm_api_base}/organizations.geojson";
    $geojson = json_decode(file_get_contents($brigades_url), true);
    
    if(!function_exists('h'))
    {
        function h($s) 
        {
            return htmlspecialchars($s);
        }
    }

    $base_url = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/');
    
?>
<ul id="brigades-list" style="display: none">
    <? foreach($geojson['features'] as $feature) { ?>
        <li data-id="<?= h($brigade_ids[$feature['id']]) ?>"
            data-lat="<?= h($feature['geometry']['coordinates'][1]) ?>"
            data-lon="<?= h($feature['geometry']['coordinates'][0]) ?>" >
            <a href="<?= $base_url.'/brigade.php/'.rawurlencode($feature['properties']['name']) ?>"><?= h($feature['properties']['name']) ?></a>
        </li>
    <? } ?>
</ul>

{'fraction_non_alphanumeric': 0.218140589569161, 'fraction_numerical': 0.0018140589569160999, 'mean_word_length': 3.1156716417910446, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1397301', 'n_tokens_mistral': 770, 'n_tokens_neox': 773, 'n_words': 104}