示例#1
0
文件: api.py 项目: unh3x/cve-search
 def api_last(self, limit=None):
     limit = limit if limit else 30
     cvesp = CveHandler(
         rankinglookup=True, namelookup=True, via4lookup=True, capeclookup=True
     )
     cve = cvesp.get(limit=limit)
     return cve
        "author"] = "Generated with cve-search available at http://adulau.github.com/cve-search/"
    feed.feed["description"] = ""
else:
    print("<html><head>")
    print(
        "<style>.cve table { border-collapse: collapse; text-align: left; width: 100%; } .cve {font: normal 12px/150% "
        "Geneva, Arial, Helvetica, sans-serif; background: #fff; overflow: hidden; border: 1px solid #006699; "
        "-webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; }.cve table td, .cve table th { "
        "padding: 3px 10px; }.cve table tbody td { color: #00496B; border-left: 1px solid #E1EEF4;font-size: "
        "12px;font-weight: normal; }.cve table tbody .alt td { background: #E1EEF4; color: #00496B; }.cve table tbody "
        "td:first-child { border-left: none; }.cve table tbody tr:last-child td { border-bottom: none; }.cve table "
        "tfoot td div { border-top: 1px solid #006699;background: #E1EEF4;} .cve table tfoot td { padding: 0; "
        "font-size: 12px } .cve table tfoot td div{ padding: 0px; }</style> ")
    print("<title>Last " + str(args.l) + " CVE entries</title>")
    print("</head><body>")
for x in cvelist.get(limit=last_items):
    if not (args.f == "html"):
        item = {
            "title": str(x["id"]) + " " + x["summary"][:90] + "...",
            "description": x["summary"]
        }
        if args.r and x.get("ranking"):
            item["description"] = item["description"] + " Ranking:" + str(
                x["ranking"])
        item["pubDate"] = time.localtime()
        item["guid"] = x["id"]
        if x["references"]:
            item["link"] = str(x["references"][0])
        else:
            item[
                "link"] = "http://web.nvd.nist.gov/view/vuln/detail?vulnId=" + x[