示例#1
0
文件: views.py 项目: brlogan/crits
def campaign_stats(request):
    """
    Generate Campaign stats template.

    GET Parameters:
        refresh: Whether or not this is a data refresh (Default: no)
        campaign: Limit to a specific Campaign (Default: all)

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :returns: :class:`django.http.HttpResponse`
    """

    refresh = request.GET.get("refresh", "no")
    campaign = request.GET.get("campaign", "all")
    if refresh == "yes":
        campaign_date_stats()
    if request.is_ajax():
        data_list = get_campaign_stats(campaign)
        return HttpResponse(json.dumps(data_list,
                                       default=json_util.default),
                            content_type="application/json")
    else:
        return render_to_response("campaign_monthly.html",
                                  {'campaign': campaign},
                                  RequestContext(request))
示例#2
0
def campaign_stats(request):
    """
    Generate Campaign stats template.

    GET Parameters:
        refresh: Whether or not this is a data refresh (Default: no)
        campaign: Limit to a specific Campaign (Default: all)

    :param request: Django request object (Required)
    :type request: :class:`django.http.HttpRequest`
    :returns: :class:`django.http.HttpResponse`
    """

    refresh = request.GET.get("refresh", "no")
    campaign = request.GET.get("campaign", "all")
    if refresh == "yes":
        campaign_date_stats()
    if request.is_ajax():
        data_list = get_campaign_stats(campaign)
        return HttpResponse(json.dumps(data_list, default=json_util.default),
                            mimetype="application/json")
    else:
        return render_to_response("campaign_monthly.html",
                                  {'campaign': campaign},
                                  RequestContext(request))
    def handle(self, *args, **options):
        """
        Script Execution.
        """

        stats.generate_yara_hits()
        stats.generate_sources()
        stats.generate_filetypes()
        stats.generate_campaign_stats()
        stats.generate_counts()
        stats.target_user_stats()
        stats.campaign_date_stats()
示例#4
0
    def handle(self, *args, **options):
        """
        Script Execution.
        """

        stats.generate_yara_hits()
        stats.generate_sources()
        stats.generate_filetypes()
        stats.generate_campaign_stats()
        stats.generate_counts()
        stats.target_user_stats()
        stats.campaign_date_stats()