You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

Web-Feed

Structr offers in-built support for web feeds. This article will provide detailed information on how to integrate feeds into an existing instance.

Data Types

A web feed is reduced to certain components that can be represented within the database.

Name | Description
– | –
DataFeed | The built-in type DataFeed is used to specify the source of a web feed. Once created, Structr is able to pull FeedItem entries from that source.
FeedItem | Contains information about a specific entry from a web feed. Furthermore relations to the feed entries’ content and enclosures are provided in the form of FeedItemContent and FeedItemEnclosure.
FeedItemContent | Represents the information found within the <content>-tag of a web feed item and relates to a FeedItem.
FeedItemEnclosure | Represents the information found within the <enclosure>-tag of a web feed item and relates to a FeedItem.

Configuring the web feed component

  1. Stop the Structr instance using sudo service structr-ui stop.
  2. Set up the CronService within structr.conf to run the UpdateFeedTask periodically . See below for an example configuration.
  3. Restart the instance using sudo service structr-ui start.

#### Specifying the feed update task for the CronService
CronService.tasks = org.structr.feed.cron.UpdateFeedTask

#### Setting up the execution interval in enhanced cron time format <minute> <hour> <day of the month> <month of the year> <day of the week> <year>
# In this example the web feed will be updated every 5 minutes
org.structr.feed.cron.UpdateFeedTask.cronExpression =  5 * * * * *  

Setting up feeds

Create at least one DataFeed entry and specify the necessary attributes. Fore more details regarding this process refer to the DataFeed article.

Accessing the feed data

Once the CronService has executed the UpdateFeedTask at least once, the feed data will be saved as FeedItem entries within the database and can be queried using the data types described above.

Hint

To automatically make newly created FeedItem entries visible to all users, add a custom onCreate Callback-Function that sets the visibleToPublicUsers and visibleToAuthenticatedUsers attributes to true.

Search results for "Web-Feed"

We could not find anything matching "Web-Feed" in our documentation. Please rephrase your search.

You can also ask your questions in the Structr Google Group or create a free account in the Structr Support Portal.
Click here to send feedback to the Structr team.