def get(self): website=Setting().all().fetch(1) if len(website)==0: web=Setting() web.webSite='http://im.zxxsbook.com' web.put() else: web=website[0] # devdate=datetime.datetime.strptime('2012-12-17','%Y-%m-%d') # for c in RSS.all().filter('updateTime <',devdate): # c.issync=False # c.put() for c in RSS.all().filter('issync =',False): pam={} if c.code: pam['GroupId']=c.code pam['GroupName']=c.groupname.encode('utf-8') pam['UserName']=setting.adminname pam['GroupType']=c.type pam['GroupAppType']= setting.APPCODE_TYPE pam['GroupHead']=c.head pam['GroupTag']=c.tag.encode('utf-8') login_url = web.webSite+'/SyncGroup' login_data = urllib.urlencode(pam) result = urlfetch.fetch( url = login_url, payload = login_data, method = urlfetch.POST, headers = {'Content-Type':'application/x-www-form-urlencoded', 'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6'}, follow_redirects = False,deadline=10) if result.status_code == 200 and result.content!='0': c.code=result.content c.issync=True c.put() memcache.delete('rsslist') else: logging.error('send news failure !')
def get(self): for c in RSS.all(): c.issync=False c.put()
def get(self): self.render('templates/rsslist.html',{'rsslist':RSS.all().order('-updateTime')})