mirror of
https://github.com/heyarne/berliner-winter.git
synced 2026-05-06 19:23:39 +02:00
Add category to the database
This commit is contained in:
parent
24ffdeb1ec
commit
b229e1a6c4
2 changed files with 12 additions and 4 deletions
|
|
@ -93,7 +93,7 @@ def get_categories(article_body):
|
|||
}
|
||||
found_categories = [bad_words[key] for key in bad_words
|
||||
if key in article_body.lower()]
|
||||
return found_categories or ['other']
|
||||
return found_categories
|
||||
|
||||
def get_geoloc(query):
|
||||
confidence_map = {
|
||||
|
|
@ -104,8 +104,9 @@ def get_geoloc(query):
|
|||
}
|
||||
|
||||
params = {
|
||||
"address": query + ", Berlin",
|
||||
"components": "country:DE"
|
||||
"address": query,
|
||||
"components": "country:DE|administrative_area:Berlin",
|
||||
"sensor": False
|
||||
}
|
||||
|
||||
url = "http://maps.googleapis.com/maps/api/geocode/json?" + urlencode(params)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue