def get(self,format,id):
		#set content-type
		self.response.headers['Content-Type'] = Formatter.contentType(format)
		
		#get consumer/client app id
		appid = 'Unknown'
		if (self.request.GET):
			if ('appid' in self.request.GET):
				appid = self.request.GET['appid']
			if ('app' in self.request.GET):
				appid = self.request.GET['app']
		
		referer = ''
		if ('HTTP_REFERER' in os.environ):
			referer = os.environ['HTTP_REFERER']
		
		returnData = APIContent.getHackerNewsPost(id,format,self.request.url, referer, self.request.remote_addr)
			
		#track this request
		GAHelper.trackGARequests('/post/%s' % (id), appid, referer)
		
		if (not returnData):
			returnData = ''
		
		#output to the browser
		self.response.out.write(Formatter.dataWrapper(format, returnData, self.request.get('callback')))
    def get(self, format='json', page=''):
        #set content-type
        self.response.headers['Content-Type'] = Formatter.contentType(format)

        referer = ''
        if ('HTTP_REFERER' in os.environ):
            referer = os.environ['HTTP_REFERER']

        returnData = APIContent.getHackerNewsNewestContent(page, format, self.request.url, referer, self.request.remote_addr)
        if (not returnData or returnData == None or returnData == '' or returnData == 'None'):
            #call the service again this time without the pageID
            returnData = APIContent.getHackerNewsNewestContent('', format, self.request.url, referer, self.request.remote_addr)

        #track this request
        GAHelper.trackGARequests('/newest', self.request.remote_addr, referer)

        #output to the browser
        self.response.out.write(Formatter.dataWrapper(format, returnData, self.request.get('callback')))
    def get(self, format="json", page=""):
        # set content-type
        self.response.headers["Content-Type"] = Formatter.contentType(format)

        referer = ""
        if "HTTP_REFERER" in os.environ:
            referer = os.environ["HTTP_REFERER"]

        returnData = APIContent.getHackerNewsBestContent(
            page, format, self.request.url, referer, self.request.remote_addr
        )
        if not returnData or returnData == None or returnData == "" or returnData == "None":
            # call the service again this time without the pageID
            returnData = APIContent.getHackerNewsBestContent(
                "", format, self.request.url, referer, self.request.remote_addr
            )

            # track this request
        GAHelper.trackGARequests("/best", self.request.remote_addr, referer)

        # output to the browser
        self.response.out.write(Formatter.dataWrapper(format, returnData))
    def get(self, format='json'):
        #set content-type
        self.response.headers['Content-Type'] = Formatter.contentType(format)

        returnData = MutableString()
        returnData = APIContent.getHackerNewsRSS(format)

        referer = ''
        if ('HTTP_REFERER' in os.environ):
            referer = os.environ['HTTP_REFERER']

        #track this request
        GAHelper.trackGARequests('/rss', self.request.remote_addr, referer)

        #output to the browser
        self.response.out.write(Formatter.dataWrapper(format, returnData, self.request.get('callback')))
	def get(self,format,user):
		#set content-type
		self.response.headers['Content-Type'] = Formatter.contentType(format)
		
		referer = ''
		if ('HTTP_REFERER' in os.environ):
			referer = os.environ['HTTP_REFERER']
		
		returnData = APIContent.getHackerNewsSubmittedContent(user,format,self.request.url, referer, self.request.remote_addr)
			
		#track this request
		GAHelper.trackGARequests('/submitted/%s' % (user), self.request.remote_addr, referer)
		
		if (not returnData):
			returnData = ''
		
		#output to the browser
		self.response.out.write(Formatter.dataWrapper(format, returnData))
    def get(self, format='json', limit=1):
        #set content-type
        self.response.headers['Content-Type'] = Formatter.contentType(format)

        referer = ''
        if ('HTTP_REFERER' in os.environ):
            referer = os.environ['HTTP_REFERER']

        returnData = APIContent.getHackerNewsLatestContent('', format, self.request.url, referer, self.request.remote_addr, limit)

        #track this request
        GAHelper.trackGARequests('/latest', self.request.remote_addr, referer)

        if (not returnData):
            returnData = ''

        #output to the browser
        self.response.out.write(Formatter.dataWrapper(format, returnData, self.request.get('callback')))
    def get(self, format, user):
        # set content-type
        self.response.headers["Content-Type"] = Formatter.contentType(format)

        referer = ""
        if "HTTP_REFERER" in os.environ:
            referer = os.environ["HTTP_REFERER"]

        returnData = APIContent.getHackerNewsSubmittedContent(
            user, format, self.request.url, referer, self.request.remote_addr
        )

        # track this request
        GAHelper.trackGARequests("/submitted/%s" % (user), self.request.remote_addr, referer)

        if not returnData:
            returnData = ""

        # output to the browser
        self.response.out.write(Formatter.dataWrapper(format, returnData, self.request.get("callback")))