示例#1
0
 def renderurl(self):
     try:
         content = proxyurl("http://reddit.infogami.com" + request.fullpath)
         return self.rendercontent(content)
     except HTTPError, e:
         if e.code == 404:
             return self.abort404()
         else:
             print "error %s" % e.code
             print e.fp.read()
示例#2
0
文件: embed.py 项目: cmak/reddit
 def renderurl(self):
     try:
         content = proxyurl("http://reddit.infogami.com"+request.fullpath)
         return self.rendercontent(content)
     except HTTPError, e:
         if e.code == 404:
             return self.abort404()
         else:
             print "error %s" % e.code
             print e.fp.read()
示例#3
0
文件: embed.py 项目: bqevin/reddit
def renderurl_cached(path):
    # Needed so http://reddit.com/help/ works
    fp = path.rstrip("/")
    u = "http://code.reddit.com/wiki" + fp + "?stripped=1"

    g.log.debug("Pulling %s for help" % u)

    try:
        return fp, proxyurl(u)
    except HTTPError, e:
        if e.code != 404:
            print "error %s" % e.code
            print e.fp.read()
        return (None, None)
示例#4
0
文件: embed.py 项目: rajbot/tikical
    def renderurl(self):

        # Needed so http://reddit.com/help/ works
        fp = request.path.rstrip("/")
        u = "http://code.reddit.com/wiki" + fp + '?stripped=1'

        try:
            content = proxyurl(u)
            return self.rendercontent(content, fp)
        except HTTPError, e:
            if e.code != 404:
                print "error %s" % e.code
                print e.fp.read()
            return self.abort404()
示例#5
0
文件: embed.py 项目: mxr249/reddit-1
def renderurl_cached(path):
    # Needed so http://reddit.com/help/ works
    fp = path.rstrip("/")
    u = "http://code.reddit.com/wiki" + fp + '?stripped=1'

    g.log.debug("Pulling %s for help" % u)

    try:
        return fp, proxyurl(u)
    except HTTPError, e:
        if e.code != 404:
            print "error %s" % e.code
            print e.fp.read()
        return (None, None)
示例#6
0
文件: embed.py 项目: aguamar/reddit
    def renderurl(self):

        # Needed so http://reddit.com/help/ works
        fp = request.path.rstrip("/")
        u = "http://code.reddit.com/wiki" + fp + '?stripped=1'

        g.log.debug("Pulling %s for help" % u)

        try:
            content = proxyurl(u)
            return self.rendercontent(content, fp)
        except HTTPError, e:
            if e.code != 404:
                print "error %s" % e.code
                print e.fp.read()
            return self.abort404()
示例#7
0
文件: embed.py 项目: donslice/reddit
    def renderurl(self, override=None):
        if override:
            path = override
        else:
            path = request.path

        # Needed so http://reddit.com/help/ works
        fp = path.rstrip("/")
        u = "http://code.reddit.com/wiki" + fp + '?stripped=1'

        g.log.debug("Pulling %s for help" % u)

        try:
            content = proxyurl(u)
            return self.rendercontent(content, fp)
        except HTTPError, e:
            if e.code != 404:
                print "error %s" % e.code
                print e.fp.read()
            return self.abort404()