Skip to content

Commit bc9601d

Browse files
authored
Update WigleSearch.py
1 parent 3c10b44 commit bc9601d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

WigleSearch.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,14 @@ def fetch_wigle_data(ssid, token_name, api_token, max_results):
5656
return all_results
5757

5858

59+
def filter_case_sensitive(results, target_ssid):
60+
filtered = [entry for entry in results if entry.get('ssid') == target_ssid]
61+
print(f"[*] Case-sensitive filtering enabled:")
62+
print(f" Total fetched: {len(results)}")
63+
print(f" Matched exact SSID '{target_ssid}': {len(filtered)}")
64+
return filtered
65+
66+
5967
def save_as_json(results, output_file):
6068
with open(output_file, 'w') as f:
6169
json.dump(results, f, indent=2)
@@ -98,6 +106,7 @@ def main():
98106
parser.add_argument('--output', default=None, help='Output file (default: <SSID>_wigle_results.json or .kml)')
99107
parser.add_argument('--max', type=int, default=1000, help='Maximum number of records to fetch (default: 1000)')
100108
parser.add_argument('--format', choices=['json', 'kml'], default='json', help='Output format: json (default) or kml')
109+
parser.add_argument('--exact-case', action='store_true', help='Enable case-sensitive filtering on SSID matches')
101110

102111
args = parser.parse_args()
103112

@@ -107,6 +116,9 @@ def main():
107116

108117
results = fetch_wigle_data(args.ssid, args.token_name, args.token, args.max)
109118

119+
if args.exact_case:
120+
results = filter_case_sensitive(results, args.ssid)
121+
110122
if args.format == 'json':
111123
save_as_json(results, output_file)
112124
else:

0 commit comments

Comments
 (0)