Пример #1
0
def getPostsByTag(tag, page=1):
	posts = requests.get(engineservice.buildUrl("/posts/%d/tag/%s" % (page, tag,))).json()
	posts["posts"] = map(renderMarkdown, posts["posts"])

	result = blogapi.decorateDictionaryWithAPI(object=posts)
	result["tag"] = tag
	return result
Пример #2
0
def getPostByDateAndSlug(year, month, slug):
	post = requests.get(engineservice.buildUrl("/post/%d/%d/%s" % (year, month, slug,))).json()
	post["post"] = renderMarkdown(post["post"])

	return blogapi.decorateDictionaryWithAPI(object=post)
Пример #3
0
def getPosts(page):
	posts = requests.get(engineservice.buildUrl("/posts/%d" % (page,))).json()
	posts["posts"] = map(renderMarkdown, posts["posts"])

	return blogapi.decorateDictionaryWithAPI(object=posts)