Ejemplo n.º 1
0
 def post(self):
     rssUrl = self.request.get("rssUrl").strip()
     if RSS.all().filter("rssUrl =", rssUrl).count() == 0 and rssUrl:
         rss = RSS()
         rss.rssUrl = rssUrl
         rss.put()
     self.render("templates/index.html", {"RSSs": RSS.all()})
Ejemplo n.º 2
0
 def get(self):
     rsslist = []
     for r in RSS.all():
         r.r0 = Contents.all().filter("rss =", r).filter("realContentResult =", 0).count()
         r.r1 = Contents.all().filter("rss =", r).filter("realContentResult =", 1).count()
         r.r2 = Contents.all().filter("rss =", r).filter("realContentResult =", 2).count()
         r.r3 = Contents.all().filter("rss =", r).filter("realContentResult =", 3).count()
         r.r4 = Contents.all().filter("rss =", r).filter("realContentResult =", 4).count()
         r.r5 = Contents.all().filter("rss =", r).filter("realContentResult =", 5).count()
         r.r6 = Contents.all().filter("rss =", r).filter("realContentResult =", None).count()
         rsslist.append(r)
     self.render("templates/analysis.html", {"RSSs": rsslist})
Ejemplo n.º 3
0
    def get(self):
        self.saveRssList = []
        self.saveRssMap = {}
        self.urls = []
        rsslist = memcache.get("rsslist")
        if not rsslist:
            rsslist = []
            for r in RSS.all().order("updateTime"):
                rsslist.append(r)
            memcache.set("rsslist", rsslist, 36000)
        for rss in rsslist:
            if not rss.code:
                self.urls.append((rss, rss.rssUrl))

        self.searchRSS()
Ejemplo n.º 4
0
    def get(self):
        self.saveRssList = []
        self.saveRssMap = {}
        self.urls = []
        rsslist = memcache.get("rsslist")
        if not rsslist:
            rsslist = []
            for r in RSS.all().order("updateTime"):
                rsslist.append(r)
            memcache.set("rsslist", rsslist, 36000)
        #        import random
        #        s=random.randint(0,len(rsslist)-1)
        #        if  s%2==1:
        #            rsslist.reverse()
        #        s=random.randint(0,len(rsslist)-1)
        ls = rsslist[:50]
        rsslist = rsslist[50:] + ls
        memcache.set("rsslist", rsslist, 36000)
        for rss in ls:
            if rss.code:
                self.urls.append((rss, rss.rssUrl))

        self.searchRSS()
Ejemplo n.º 5
0
 def get(self):
     self.render("templates/index.html", {"RSSs": RSS.all()})