Skip to content

Available data for feeds

Lucas Verney edited this page Jul 23, 2014 · 5 revisions

Feeds are represented as associative arrays. The following elements can be used:

  • id which is the feed id in the database.

  • title which is the feed title, as specified by the feed itself or replaced by the user.

  • has_user_title which is a boolean to specify wether the user updated the title himself or not. For instance, if the user updated the feed title manually, this should not be overwritten when refreshing the feed.

  • url is the feed URL.

  • links is an array of arrays for each available links. So, basically, links is:

[{'url': SOME_URL, 'rel': SOME_REL_ATTRIBUTE, 'title': SOME_TITLE_PROVIDED}, {'url': SOME_URL2, 'rel': SOME_REL_ATTRIBUTE2, 'title': SOME_TITLE_PROVIDED2}, …]

Note: I use JSON notation for arrays for ease of notation, but it is actually a PHP array.

  • description is a description provided by the feed itself.

  • ttl is a time-to-live provided by the feed, to specify how often it should be refreshed. 0 means that the global config frequency will be used.

  • has_user_ttl specifies wether the user updated manually the TTL for this feed or not. If the user updated the TTL manually for this feed, it should not be overwritten by a feed refresh.

  • image is an array representing an image to display with the feed. It can be for either an image specified in the feed, or the favicon associated with the feed, if it could be retrieved. It is basically:

{'url': IMAGE_URL, 'title': IMAGE_TITLE, 'link': IMAGE_LINK}
  • post is an array of POST params to send with the feed. It is basically (in JSON notation, but it is present as a PHP array in the script):
{'param1': VALUE1, 'param2': VALUE2, …}

The above elements are stored directly in the database, and they correspond to the database fields. Please note that some elements may be empty, as explained in the RSS and ATOM specifications.

TODO : Tags (for now, I think it will be a list of tags, as an array associated to the tags key for each feed.

Note: All the arrays are available as PHP arrays in the script, but are stored as JSON strings in the database.