Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Yohanna Lisnichuk <yohanitalisnichuk@gmail.com>
  • Loading branch information
aguilerapy and yolile committed Sep 2, 2020
1 parent 56b29d5 commit acb59fe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions kingfisher_scrapy/util.py
Expand Up @@ -165,7 +165,10 @@ def grouper(iterable, n, fillvalue=None):
return itertools.zip_longest(*args, fillvalue=fillvalue)


def get_parameter_value(url, parameter_name):
def get_parameter_value(url, key):
"""
Returns the value of the given ``key`` in ``url``.
"""
query = parse_qs(urlsplit(url).query)
if parameter_name in query:
return int(query[parameter_name][0])
if key in query:
return int(query[key][0])

0 comments on commit acb59fe

Please sign in to comment.