def refreshUserFeeds(userid): ''' after first time login of user this gets invoked by an ID provided by UI like Request: https://wowgicflaskapp-wowgic.rhcloud.com/id=q13512667 neo4j has associated feeds ID to be displayed to the user fetch them from mongdb and return it back ''' #if user hasnt currTimeStamp = request.args.get("currTimeStamp") if userid is None: return 'id is missing', 400 elif currTimeStamp is None: logger.debug( 'currTimeStamp is not passed as param so taking the current timestamp' ) currTimeStamp = str(timegm(time.gmtime( ))) # fetch latest feeds reduce 30 counts by pagintation #lastTimeStamp = time.time() - 24*60*60 #epoch time minus 1 day logger.info('ID requested is:%s and currTimeStamp : %s', userid, currTimeStamp) feedList = [] feedList.extend(intercom.fetchInterestFeeds(userid, currTimeStamp)) #store the last login jsonFBInput = {'id': userid, 'last_login': currTimeStamp} intercom.updateFBUserLoginData(jsonFBInput) return json.dumps(feedList)
def refreshUserFeeds(userid): ''' after first time login of user this gets invoked by an ID provided by UI like Request: https://http://wowgicflaskapp-wowgic.rhcloud.com/id=q13512667 neo4j has associated feeds ID to be displayed to the user fetch them from mongdb and return it back ''' #ID = request.args.get("userid") if userid is None: return 'id is missing', 400 logger.info('ID requested is:%s', userid) feedList = [] feedList.extend(intercom.fetchInterestFeeds(userid)) return json.dumps(feedList)
def refreshUserFeeds(userid): ''' after first time login of user this gets invoked by an ID provided by UI like Request: https://http://wowgicflaskapp-wowgic.rhcloud.com/id=q13512667 neo4j has associated feeds ID to be displayed to the user fetch them from mongdb and return it back ''' #ID = request.args.get("userid") if userid is None: return 'id is missing',400 logger.info('ID requested is:%s',userid) feedList=[] feedList.extend(intercom.fetchInterestFeeds(userid)) return json.dumps(feedList)
def refreshUserFeeds(userid): """ after first time login of user this gets invoked by an ID provided by UI like Request: https://http://wowgicflaskapp-wowgic.rhcloud.com/id=q13512667 neo4j has associated feeds ID to be displayed to the user fetch them from mongdb and return it back """ # if user hasnt currTimeStamp = request.args.get("currTimeStamp") if userid is None: return "id is missing", 400 elif currTimeStamp is None: logger.debug("currTimeStamp is not passed as param so taking the current timestamp") currTimeStamp = str(timegm(time.gmtime())) # fetch latest feeds reduce 30 counts by pagintation # lastTimeStamp = time.time() - 24*60*60 #epoch time minus 1 day logger.info("ID requested is:%s and currTimeStamp : %s", userid, currTimeStamp) feedList = [] feedList.extend(intercom.fetchInterestFeeds(userid, currTimeStamp)) # store the last login jsonFBInput = {"id": userid, "last_login": time.time()} intercom.updateFBUserLoginData(jsonFBInput) return json.dumps(feedList)