115 lines
3.4 KiB
Python
115 lines
3.4 KiB
Python
#!/usr/bin/env python3
|
|
"""Generate broader queries that will actually catch repair leads."""
|
|
|
|
# Strategy: Use broader terms + location keywords instead of site: filters
|
|
# This catches mentions across ALL platforms (Reddit, Facebook, Kijiji, forums)
|
|
|
|
CANADIAN_CITIES = [
|
|
"Toronto", "Mississauga", "Brampton", "Kitchener", "Waterloo", "Cambridge",
|
|
"London Ontario", "Hamilton", "Ottawa", "Montreal", "Vancouver", "Calgary",
|
|
"Edmonton", "Winnipeg"
|
|
]
|
|
|
|
CORE_SERVICES = {
|
|
"Data Recovery": [
|
|
"data recovery",
|
|
"recover my data",
|
|
"dead hard drive",
|
|
"drive not recognized",
|
|
"lost photos"
|
|
],
|
|
"MacBook Repair": [
|
|
"macbook repair",
|
|
"macbook won't turn on",
|
|
"macbook liquid damage",
|
|
"logic board repair"
|
|
],
|
|
"Console Repair": [
|
|
"ps5 repair",
|
|
"xbox repair",
|
|
"switch repair",
|
|
"hdmi port repair console"
|
|
],
|
|
"iPhone Repair": [
|
|
"iphone repair",
|
|
"iphone won't charge",
|
|
"iphone logic board",
|
|
"iphone water damage"
|
|
]
|
|
}
|
|
|
|
def generate_location_based_alert(service_name, keywords, cities):
|
|
"""Generate alert using location keywords instead of site filters."""
|
|
# Use just 4-5 keywords and 3-4 cities per alert
|
|
kw_part = " OR ".join([f'"{kw}"' for kw in keywords[:5]])
|
|
loc_part = " OR ".join([f'"{city}"' for city in cities[:4]])
|
|
|
|
query = f'({kw_part})\n({loc_part})\n-job -jobs -hiring'
|
|
|
|
return {
|
|
"name": service_name,
|
|
"query": query,
|
|
"length": len(query)
|
|
}
|
|
|
|
def generate_intent_based_alert(service_type):
|
|
"""Generate alerts focused on explicit service requests."""
|
|
intent_keywords = [
|
|
"repair shop recommendation",
|
|
"where to repair",
|
|
"anyone repair",
|
|
"repair near me",
|
|
"looking for repair"
|
|
]
|
|
|
|
service_keywords = {
|
|
"General Tech": ["laptop", "macbook", "iphone", "console"],
|
|
"Data": ["data recovery", "hard drive", "photos"],
|
|
"Logic Board": ["logic board", "motherboard", "microsolder"]
|
|
}
|
|
|
|
kw = service_keywords.get(service_type, [])
|
|
intent_part = " OR ".join([f'"{i}"' for i in intent_keywords[:4]])
|
|
service_part = " OR ".join([f'"{s}"' for s in kw])
|
|
|
|
query = f'({intent_part})\n({service_part})\nsite:reddit.com'
|
|
|
|
return {
|
|
"name": f"{service_type} - Intent Based",
|
|
"query": query,
|
|
"length": len(query)
|
|
}
|
|
|
|
if __name__ == "__main__":
|
|
print("# Broader Google Alert Queries")
|
|
print()
|
|
print("These use location keywords + service terms instead of site: filters.")
|
|
print("This catches repair requests across ALL platforms.")
|
|
print()
|
|
|
|
# Location-based alerts (Ontario focus)
|
|
ontario_cities = ["Toronto", "Mississauga", "Kitchener", "Waterloo"]
|
|
|
|
for service_name, keywords in CORE_SERVICES.items():
|
|
alert = generate_location_based_alert(service_name, keywords, ontario_cities)
|
|
print(f"## {alert['name']} - Ontario")
|
|
print(f"**Length:** {alert['length']} chars")
|
|
print()
|
|
print("```")
|
|
print(alert['query'])
|
|
print("```")
|
|
print()
|
|
|
|
# Intent-based alerts
|
|
print("## High-Intent Alerts")
|
|
print()
|
|
for service_type in ["General Tech", "Data", "Logic Board"]:
|
|
alert = generate_intent_based_alert(service_type)
|
|
print(f"### {alert['name']}")
|
|
print()
|
|
print("```")
|
|
print(alert['query'])
|
|
print("```")
|
|
print()
|
|
|