Skip to content

Commit 5e02468

Browse files
fix: add topicCategoryId filter to groupSearch query
groupSearch without a topic filter returns unrelated groups (dancing, photography, etc). Add topicCategoryId=546 (Technology) as a query variable to restrict results to tech groups. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 52cd8a9 commit 5e02468

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

app/capture_groups.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
warning = "WARNING:"
1313

1414
TECHLAHOMA_PRO_NETWORK_ID = "364335959210266624"
15+
TECHNOLOGY_TOPIC_CATEGORY_ID = "546"
1516
BASE_URL = "https://www.meetup.com"
1617

1718
SEARCH_QUERY = """
18-
query ($query: String!) {
19+
query ($query: String!, $topicCategoryId: ID) {
1920
groupSearch(
20-
filter: {query: $query, lat: 35.467560, lon: -97.516426}
21+
filter: {query: $query, lat: 35.467560, lon: -97.516426, topicCategoryId: $topicCategoryId}
2122
first: 50
2223
) {
2324
totalCount
@@ -40,7 +41,7 @@
4041
}
4142
"""
4243

43-
SEARCH_VARS = {"query": "programming"}
44+
SEARCH_VARS = {"query": "programming", "topicCategoryId": TECHNOLOGY_TOPIC_CATEGORY_ID}
4445

4546

4647
def parse_search_response(response: dict) -> list[dict]:

app/meetup_queries.gql

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,11 @@ query($urlname: String!) {
120120
}
121121

122122
# query OKC area for programming groups' IDs
123-
{"query": "programming"}
124-
query ($query: String!) {
123+
# topicCategoryId 546 = Technology (from topicCategories query)
124+
{"query": "programming", "topicCategoryId": "546"}
125+
query ($query: String!, $topicCategoryId: ID) {
125126
groupSearch(
126-
filter: {query: $query, lat: 35.467560, lon: -97.516426}
127+
filter: {query: $query, lat: 35.467560, lon: -97.516426, topicCategoryId: $topicCategoryId}
127128
first: 50
128129
) {
129130
totalCount

0 commit comments

Comments
 (0)