Creating a simple feed flow
This article provides a brief introduction and shows how to create a feed flow. You can also see the Creating a simple Assemble flow tutorial to create a project with Assemble flow support.
Create the first feed flow
Create a new directory, mynews, in the /public directory, and create the new file index.flow in the mynews folder. For this example, copy the following flow definition into the index.flow file, to aggregate the feeds from CNN and Yahoo News
<?xml version="1.0" encoding="UTF-8"?>
<process name="sortSample">
<receiveGET name="rssRcv"/>
<feed name="YahooFeed" url="http://rss.news.yahoo.com/rss/topstories"/>
<feed name="CNNFeed" url="http://rss.cnn.com/rss/cnn_topstories.rss"/>
<aggregateFeeds name="aggregate">
<input value="${YahooFeed}"/>
<input value="${CNNFeed}"/>
</aggregateFeeds>
<replyGET name="feedRply">
<input value="${aggregate}"/>
</replyGET>
</process>
To run the project and test it within the browser, go to the following URL: http://localhost:8080/mynews/.
Enhance the feed flow
The Assemble flow provides the basic operations for feed manipulation. For example, if you are only interested in the news related to United States, you can add the feedFilter activity into flow, as shown in the following example:
<?xml version="1.0" encoding="UTF-8"?>
<process name="Sample">
<receiveGET name="rssRcv"/>
<feed name="YahooFeed" url="http://rss.news.yahoo.com/rss/topstories"/>
<feed name="CNNFeed" url="http://rss.cnn.com/rss/cnn_topstories.rss"/>
<aggregateFeeds name="aggregate">
<input value="${YahooFeed}"/>
<input value="${CNNFeed}"/>
</aggregateFeeds>
<filterFeed name="feedfilter" keywords="U.S.">
<input value="${aggregate}"/>
</filterFeed>
<replyGET name="feedRply">
<input value="${feedfilter}"/>
</replyGET>
</process>
You can test it by refreshing the following page: http://localhost:8080/mynews/.
Please refer to the article Feed operators reference for more details about the feed operators. And see the article "Working with feeds" for creating the feed flow with flow editor in App Builder.