I’m pulling in an RSS feed from a Tumblr blog. Unlike WordPress, which gives a condensed version of the post in the <description> tag, Tumblr dumps the whole post into the feed with no shortened version at all. I’d like my Kynetx app only to output the first, say, 400 characters if the post is longer than that.
I could emit some JavaScript to do it, something like this:
if (post.length > 400) {
post = post.substring(0, 400);
}
Is there a way to do something like that in KRL directly?
Yes! You can use the extract function which will return an array of matches from a Regex.
Extract function documentation
Example app run on example.com using bookmarklet:
