Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const textInPostId = async (username, postId) => {
- const url = userPostJsonUrl(username, postId)
- const data = await getJsonData(url)
- return textInPostFromResponse(data)
- }
- const textInPostFromResponse = (response, types = DEFAULT_TYPES) => {
- const paragraphs = _.get(response, 'payload.value.content.bodyModel.paragraphs', [])
- const filtered = paragraphs.filter(({ type }) => types.includes(type))
- return filtered.map(({text}) => text)
- }
Add Comment
Please, Sign In to add comment