示例#1
0
def analyze_content(obj, content, content_type='text/txt', api=None):
    if api is None:
        api = OpenCalais(settings.CALAIS_API_KEY)
    return api.analyze(content, content_type=content_type)
示例#2
0
def analyze_content_field(obj, field_name, content_type='text/txt', api=None):
    if api is None:
        api = OpenCalais(settings.CALAIS_API_KEY)
    content = getattr(obj, field_name)
    return api.analyze(content, content_type=content_type)
示例#3
0
def analyze_url_field(obj, field_name, content_type='text/html', api=None):
    if api is None:
        api = OpenCalais(settings.CALAIS_API_KEY)
    url = getattr(obj, field_name)
    return api.analyze_url(url, content_type=content_type)
示例#4
0
def analyze_content(obj, content, content_type='text/txt', api=None):
    if api is None:
        api = OpenCalais(settings.CALAIS_API_KEY)
    return api.analyze(content, content_type=content_type)
示例#5
0
def analyze_content_field(obj, field_name, content_type='text/txt', api=None):
    if api is None:
        api = OpenCalais(settings.CALAIS_API_KEY)
    content = getattr(obj, field_name)
    return api.analyze(content, content_type=content_type)
示例#6
0
def analyze_url_field(obj, field_name, content_type='text/html', api=None):
    if api is None:
        api = OpenCalais(settings.CALAIS_API_KEY)
    url = getattr(obj, field_name)
    return api.analyze_url(url, content_type=content_type)