コード例 #1
0
def get_course_meta(filter_payload=None):
    url = url_api_courses % (url_api, 0, 1)

    # {"SelectCriteria":[],"DisplayFields":[],"SortOptions":[{"SortOnField":"Relevance","SortOrder":1}],"SearchKeyword":"","UILangaugeCode":"1033","UserLanguageCode":"1033"}

    if filter_payload is None:
        filter_payload = default_filter
        for lfilter in language_filter():
            filter_payload["SelectCriteria"].append(lfilter)

    result = http_request.post_json(url, filter_payload)
    json_obj = json.loads(result)

    return {"sections": json_obj["narrowBySections"], "totalResultCount": json_obj["totalResultCount"] }
コード例 #2
0
def get_course_meta(filter_payload=None):
    url = url_api_courses % (url_api, 0, 1)

    # {"SelectCriteria":[],"DisplayFields":[],"SortOptions":[{"SortOnField":"Relevance","SortOrder":1}],"SearchKeyword":"","UILangaugeCode":"1033","UserLanguageCode":"1033"}

    if filter_payload is None:
        filter_payload = default_filter
        for lfilter in language_filter():
            filter_payload["SelectCriteria"].append(lfilter)

    result = http_request.post_json(url, filter_payload)
    json_obj = json.loads(result)

    return {
        "sections": json_obj["narrowBySections"],
        "totalResultCount": json_obj["totalResultCount"]
    }
コード例 #3
0
def get_course_data(filter_payload, skip=0, take=10):
    url = url_api_courses % (url_api, skip, take)
    result = http_request.post_json(url, filter_payload)
    json_obj = json.loads(result)

    return json_obj["results"]
コード例 #4
0
def get_course_data(filter_payload, skip=0, take=10):
    url = url_api_courses % (url_api, skip, take)
    result = http_request.post_json(url, filter_payload)
    json_obj = json.loads(result)

    return json_obj["results"]