def Render(self, request):
		settings = model.Settings.Get()
		converter = FriendFeedConverter()
				
		input = simplejson.loads(request.request.body)
		#{"PageSize":"16", "PageNumber":"1", "ItemFilterType":"None", "ItemFilterArgument":"None"}
				
		json = {}
		pageNumber = int(input["PageNumber"])
		# Might want to cache this
		if input["ItemFilterType"] == u"None":
			# Front page
			ff = friendfeedproxy.FriendFeed()
			feed = ff.fetch_user_feed(settings.Username, pageNumber)
			json = converter.ConvertUserFeed(feed)
		
		feedItems = []
		item = None
		pageCount = 100
		channel = None
		comments = None
				
		#json = {}
		#json.update(FeedItems = feedItems)
		json.update(Item = item)
		json.update(PageCount = pageCount)
		json.update(Channel = channel)
		
		#json.update(Comments = comments)
		json.update(Settings = settings.to_dict())
		
		d = {}
		d.update(d = json)
		
		request.response.out.write(simplejsondate.dumps(d))
Exemple #2
0
	def Render(self, request, settings, user):
		input = simplejson.loads(request.request.body)

		feed = {}

		pageNumber = 1

		tmppageNumber = input["PageNumber"]

		if tmppageNumber != "":
			pageNumber = int(tmppageNumber)

		if input["ItemFilterType"] is None or  input["ItemFilterType"] == "None" :
			feed = []
		elif input["ItemFilterType"] == "Source":

			feed = []
		elif input["ItemFilterType"] == "Search":
			feed = []
		elif input["ItemFilterType"] == "ItemType":
			mapper = ServiceMap()
			argument = input["ItemFilterArgument"]
			mapped =  mapper.Convert(argument)

			feed = None

		json = converter.ConvertUserFeed(feed)

		d= {}
		d.update ( d = json)

		request.response.out.write(simplejsondate.dumps(d))
Exemple #3
0
	def Render(self, request, settings, user):
		input = simplejson.loads(request.request.body)

		converter = feedconverter.FeedConverter()
		json = {}
		pageNumber = int(input["PageNumber"])
		# Might want to cache this
		if input["ItemFilterType"] == u"None":
			# Front page
			feed = []
			json = {}
			
		feedItems = converter.ConvertFeed(model.SubscriptionUpdate.GetLatestOwned(user.username))
		item = None
		pageCount = 100
		channel = None
		comments = None

		json.update(FeedItems = feedItems["FeedItems"])
		json.update(Item = item)
		json.update(PageCount = pageCount)
		json.update(Channel = channel)
		json.update(Settings = settings)

		d = {}
		d.update(d = json)

		request.response.out.write(simplejsondate.dumps(d))
Exemple #4
0
	def Render(self, request, settings, user):
		converter = None

		channels = []

	
		feed = []
		channels = []

		d = { }
		d.update(d = channels)

		request.response.out.write(simplejsondate.dumps(d))
	def Render(self, request):		
		settings = model.Settings.Get()
		converter = FriendFeedConverter()
								
		channels = []
		
		ff = friendfeedproxy.FriendFeed()
		feed = ff.fetch_user_profile(settings.Username)
		channels = converter.ConvertChannels(feed)
		
		d = { }
		d.update(d = channels)
		
		request.response.out.write(simplejsondate.dumps(d))
Exemple #6
0
	def Render(self, request, settings, user):
		input = simplejson.loads(request.request.body)
		converter = None

		channels = []

		entry = None		
		detail = None
		feed = []
		json = None

		detail.update(Settings = settings)
		detail.update(FeedItems = json["FeedItems"])

		d = { }
		d.update(d = detail)

		request.response.out.write(simplejsondate.dumps(d))
Exemple #7
0
	def Render(self, request, settings, user):
		mapper = ServiceMap()
		input = simplejson.loads(request.request.body)
		itemtype = input["itemtype"]

		numberToReturn = input["numberToReturn"]
		numberToReturn = int(numberToReturn) / 16 # Work out the page to get to.
		
		items = mapper.Convert(itemtype)
		#logging.info("OUT: %s %s" % (numberToReturn,items))

		feed = []

		json = converter.ConvertUserFeed(feed)

		d = { }
		d.update(d = json["FeedItems"])

		request.response.out.write(simplejsondate.dumps(d))
	def Render(self, request):
		input = simplejson.loads(request.request.body)
		#{"itemID":"75377fc9-1b93-58ff-c066-defcb55ff45e", "numberToReturn":"10"}
		settings = model.Settings.Get()
		converter = FriendFeedConverter()
								
		channels = []
		
		ff = friendfeedproxy.FriendFeed()
		entry = ff.fetch_entry(input[u"itemID"])		
		detail = converter.ConvertEntry(entry)
		feed = ff.fetch_user_feed(settings.Username, 1 , service = detail["Item"]["SourceTypeName"].lower())
		json = converter.ConvertUserFeed(feed)
		
		detail.update(Settings = settings.to_dict())
		detail.update(FeedItems = json["FeedItems"])

		d = { }
		d.update(d = detail)
		
		request.response.out.write(simplejsondate.dumps(d))
	def Render(self, request):
		input = simplejson.loads(request.request.body)
		
		settings = model.Settings.Get()
		converter = FriendFeedConverter()
				
		feed = {}
		
		pageNumber = int(input["PageNumber"])
		
		if input["ItemFilterType"] is None or  input["ItemFilterType"] == "None" :
			ff = friendfeedproxy.FriendFeed()
			feed = ff.fetch_user_feed(settings.Username, pageNumber, service = input["ItemFilterArgument"])
		elif input["ItemFilterType"] == "Source":
			ff = friendfeedproxy.FriendFeed()
			feed = ff.fetch_user_service_feed(settings.Username, input["ItemFilterArgument"], pageNumber)
		elif input["ItemFilterType"] == "Search":
			ff = friendfeedproxy.FriendFeed()
			kwargs = {}
			kwargs["from"] = settings.Username
			query = input["ItemFilterArgument"]

			feed = ff.search(query, pageNumber,  **kwargs )
		elif input["ItemFilterType"] == "ItemType":
			argument = input["ItemFilterArgument"]
			logging.info("Filtering on Type %s" % argument)
						
			ff = friendfeedproxy.FriendFeed()
			feed = ff.fetch_user_services_feed(settings.Username, serviceTypeMap[argument], pageNumber)
		
		json = converter.ConvertUserFeed(feed)
		
		d= {}
		d.update ( d = json)
		
		request.response.out.write(simplejsondate.dumps(d))