You are here

function _parser_common_syndication_link in FeedAPI 5

Same name and namespace in other branches
  1. 6 parser_common_syndication/parser_common_syndication.inc \_parser_common_syndication_link()

Extract the link that points to the original content (back to site or origi

Parameters

$links: Array of SimpleXML objects

1 call to _parser_common_syndication_link()
_parser_common_syndication_atom10_parse in parser_common_syndication/parser_common_syndication.module
Parse atom feeds.

File

parser_common_syndication/parser_common_syndication.module, line 731
Parse the incoming URL with SimpleXML then provide a data structure of the feed. Requires PHP5 because of SimpleXML.

Code

function _parser_common_syndication_link($links) {
  $to_link = '';
  if (count($links) > 0) {
    foreach ($links as $link) {
      $link = $link
        ->attributes();
      $to_link = isset($link["href"]) ? "{$link["href"]}" : "";
      if (isset($link["rel"])) {
        if ("{$link["rel"]}" == 'alternate') {
          break;
        }
      }
    }
  }
  return $to_link;
}