yasserrmd commited on
Commit
d752a14
·
verified ·
1 Parent(s): 88048c6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -94,12 +94,13 @@ def get_contribution_count_graphql(username, github_token, days=30):
94
 
95
  def is_uae_location(location):
96
  """
97
- Check if location string indicates UAE
98
  """
99
  if not location:
100
  return False
101
 
102
- location = location.lower()
 
103
 
104
  # Country-level keywords (highest priority)
105
  country_keywords = [
@@ -129,14 +130,14 @@ def is_uae_location(location):
129
  'الإمارات'
130
  ]
131
 
132
- # Check country keywords first
133
  for keyword in country_keywords:
134
- if keyword in location:
135
  return True
136
 
137
- # Then check city keywords
138
  for keyword in city_keywords:
139
- if keyword in location:
140
  return True
141
 
142
  return False
@@ -362,6 +363,8 @@ with gr.Blocks(theme=gr.themes.Soft(), title="GitHub UAE Top Contributors") as a
362
  **This tool ranks UAE-based developers by their actual contribution count from GitHub's official API.**
363
 
364
  ⚠️ **IMPORTANT:** You MUST provide a GitHub Personal Access Token with `read:user` scope for accurate contribution counts.
 
 
365
  """)
366
 
367
  with gr.Row():
 
94
 
95
  def is_uae_location(location):
96
  """
97
+ Check if location string indicates UAE - case insensitive matching
98
  """
99
  if not location:
100
  return False
101
 
102
+ # Convert to lowercase and strip whitespace for comparison
103
+ location_lower = location.lower().strip()
104
 
105
  # Country-level keywords (highest priority)
106
  country_keywords = [
 
130
  'الإمارات'
131
  ]
132
 
133
+ # Check country keywords first (case insensitive)
134
  for keyword in country_keywords:
135
+ if keyword.lower() in location_lower:
136
  return True
137
 
138
+ # Then check city keywords (case insensitive)
139
  for keyword in city_keywords:
140
+ if keyword.lower() in location_lower:
141
  return True
142
 
143
  return False
 
363
  **This tool ranks UAE-based developers by their actual contribution count from GitHub's official API.**
364
 
365
  ⚠️ **IMPORTANT:** You MUST provide a GitHub Personal Access Token with `read:user` scope for accurate contribution counts.
366
+
367
+ **Confirmed to find:** YASSERRMD (Sharjah), zning1994 (Dubai), nkapila6 (Dubai), tschm (Abu Dhabi) and many more!
368
  """)
369
 
370
  with gr.Row():