コード例 #1
0
ファイル: fetchdb.py プロジェクト: alexliyu/lincdm
    def __Parse_image(self, content):
        images = htmllib.Parse_images_url(content)

        if images:
            try:
                for image in images:
                    tmpimage = Media.all().filter("oldurl = ", image).get()
                    if tmpimage != None:
                        content = gbtools.stringQ2B(content)
                        content = htmllib.decoding(content).replace(image, tmpimage.PhotoUrl())

            except Exception, data:
                logging.info(data)
コード例 #2
0
    def __Parse_image(self, content):
        images = htmllib.Parse_images_url(content)

        if images:
            try:
                for image in images:
                    tmpimage = Media.all().filter('oldurl = ', image).get()
                    if tmpimage != None:
                        content = gbtools.stringQ2B(content)
                        content = htmllib.decoding(content).replace(
                            image, tmpimage.PhotoUrl())

            except Exception, data:
                logging.info(data)
コード例 #3
0
ファイル: checkimage.py プロジェクト: alexliyu/lincdm
		def __Parse_image(self, entry):

				images = htmllib.Parse_images_url(entry.content)
				content = ''

				if images:
					try:
						for image in images:
								tmpimage = Media.all().filter('oldurl = ', image).get()
								if tmpimage != None:
										content = gbtools.stringQ2B(content)
										content = htmllib.decoding(entry.content).replace(image, tmpimage.PhotoUrl())
								else:
										pass

					except Exception, data:
						return None
					return content
コード例 #4
0
    def __Parse_image(self, entry):

        images = htmllib.Parse_images_url(entry.content)
        content = ''

        if images:
            try:
                for image in images:
                    tmpimage = Media.all().filter('oldurl = ', image).get()
                    if tmpimage != None:
                        content = gbtools.stringQ2B(content)
                        content = htmllib.decoding(entry.content).replace(
                            image, tmpimage.PhotoUrl())
                    else:
                        pass

            except Exception, data:
                return None
            return content
コード例 #5
0
ファイル: feedblog.py プロジェクト: alexliyu/lincdm
		def post(self):
				url = self.param('url')
				start_target = self.param('start_target')
				if not start_target:
						start_target = 'nohtml'
				allow_target = self.param('allow_target')
				if not allow_target:
						allow_target = 'nohtml'
				mid_target = self.param('mid_target')
				if not mid_target:
						mid_target = 'nohtml'
				end_target = self.param('end_target')
				if not end_target:
						end_target = 'nohtml'
				stop_target = self.param('stop_target')
				if stop_target:
						stop_target = htmllib.decoding(stop_target)
				else:
						stop_target = 'nohtml'
				result = self.dotest(url, start_target, mid_target, end_target, allow_target, stop_target)
				if result == False:
					self.write ('there is something wrong,please try again')
コード例 #6
0
ファイル: feedblog.py プロジェクト: alexliyu/lincdm
 def post(self):
     url = self.param('url')
     start_target = self.param('start_target')
     if not start_target:
         start_target = 'nohtml'
     allow_target = self.param('allow_target')
     if not allow_target:
         allow_target = 'nohtml'
     mid_target = self.param('mid_target')
     if not mid_target:
         mid_target = 'nohtml'
     end_target = self.param('end_target')
     if not end_target:
         end_target = 'nohtml'
     stop_target = self.param('stop_target')
     if stop_target:
         stop_target = htmllib.decoding(stop_target)
     else:
         stop_target = 'nohtml'
     result = self.dotest(url, start_target, mid_target, end_target,
                          allow_target, stop_target)
     if result == False:
         self.write('there is something wrong,please try again')