Purpose

This is a script I wrote to create a custom filtered placefile for Spotter Network in GRLevel3 and GR2Analyst Edition. This has been updated in 2025 to use PHP instead of Perl

You just maintain the $show array with the names you wish to display and away you go.

Requirements

You must have a web server which can run PHP scripts. This will not work if you do not have a web server.

Once executed, the script will download the place file from the Spotter Network servers, parse for users, and display the matches creating a perfect uncluttered GRLevelX placefile.

Issues

If you add a name with an apostrophe in it, you need to escape it first with a front slash like such:
Ben\’s Notlegalusername

Script

<?php
// Set content type to plain text for web display
header('Content-Type: text/plain');

// Product ID for User-Agent
$product_id = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36';

// List of names to filter
$show = [
    'Bill Oosterbaan',
    'Jr Hehnly',
    'Tim Marshall'
];

// Output static header content
echo <<<EOT
Refresh: 1
Threshold: 999
Title: Custom SN Positions
Font: 1, 14, 0, "Arial"
IconFile: 1, 30, 30, 15, 15, "https://www.spotternetwork.org/iconsheets/Spotternet_096.png"
IconFile: 2, 21, 35, 10, 17, "https://www.spotternetwork.org/iconsheets/Arrows_096.png"
IconFile: 6, 30, 30, 15, 15, "https://www.spotternetwork.org/iconsheets/Spotternet_New_096.png"
EOT;

// Set up HTTP context with User-Agent
$context = stream_context_create([
    'http' => [
        'header' => "User-Agent: $product_id\r\n"
    ]
]);

// Fetch data from the URL
$url = 'https://www.spotternetwork.org/feeds/gr.txt';
$content = @file_get_contents($url, false, $context);

// Check for fetch errors
if ($content === false) {
    echo "Error: Unable to fetch data from $url\n";
    exit;
}

// Extract content starting from position 352
$content = substr($content, 362);

 echo "\n\n";
// Split content by 'End:'
$values = explode('End:', $content);

// Process each value
foreach ($values as $val) {
    // Match the name in the Text field using regex
    if (preg_match('/Text:\s*15,\s*10,\s*1,\s*"([^"]+)"/', $val, $matches)) {
        $name = $matches[1];
        // Check if the name is in the $show array
        if (in_array($name, $show)) {
            echo $val . "End:\n";
        }
    }
}
?>