You are here

public static function Feed::getCommonSyndication in Feeds 8.3

Discovers RSS or Atom feeds from a document.

If the document is an HTML document, this attempts to discover RSS or Atom feeds referenced from the page.

Parameters

string $url: The URL of the document.

string $document: The document to find feeds in. Either an HTML or XML document.

Return value

string|false The discovered feed, or false if a feed could not be found.

1 call to Feed::getCommonSyndication()
HttpFetcherFeedForm::validateConfigurationForm in src/Feeds/Fetcher/Form/HttpFetcherFeedForm.php
Form validation handler.

File

src/Utility/Feed.php, line 28

Class

Feed
Helper functions for dealing with feeds.

Namespace

Drupal\feeds\Utility

Code

public static function getCommonSyndication($url, $document) {

  // If this happens to be a feed then just return the url.
  if (static::isFeed($document)) {
    return $url;
  }
  return static::findFeed($url, $document);
}