FeedsHelper
extends Helper
in package
implements
CrawlConstants
Helper used to draw links and snippets for RSS feeds
Tags
Interfaces, Classes, Traits and Enums
- CrawlConstants
- Shared constants and enums used by components that are involved in the crawling process
Table of Contents
- __construct() : mixed
- The constructor at this point does nothing
- getPubdateString() : string
- Write as an string in the current locale the difference between the publication date of a post and the current time
- render() : mixed
- Takes page summaries for RSS pages and the current query and draws list of news links and a link to the news link subsearch page if applicable.
- renderFeedItem() : mixed
- Renders one search source feed item into SERP.
Methods
__construct()
The constructor at this point does nothing
public
__construct() : mixed
Return values
mixed —getPubdateString()
Write as an string in the current locale the difference between the publication date of a post and the current time
public
getPubdateString(int $time, int $pub_date[, bool $relative_times = true ]) : string
Parameters
- $time : int
-
timestamp for current time
- $pub_date : int
-
timestamp for feed_item publication
- $relative_times : bool = true
-
if true use relative times like y seconds ago
Return values
string —in the current locale the time difference
render()
Takes page summaries for RSS pages and the current query and draws list of news links and a link to the news link subsearch page if applicable.
public
render(array<string|int, mixed> $feed_pages, string $csrf_token, string $query, string $subsearch[, bool $open_in_tabs = false ]) : mixed
Parameters
- $feed_pages : array<string|int, mixed>
-
page data from news feeds
- $csrf_token : string
-
token to prevent cross site request forgeries
- $query : string
-
the current search query
- $subsearch : string
-
the name of the subsearch of this feed For example, one could have sports feed, a news feed, etc
- $open_in_tabs : bool = false
-
whether new links should be opened in tabs
Return values
mixed —renderFeedItem()
Renders one search source feed item into SERP.
public
renderFeedItem(array<string|int, mixed> $page, string $csrf_token, string $query, string $subsearch, bool $open_in_tabs) : mixed
Parameters
- $page : array<string|int, mixed>
-
page data of a feed item to render
- $csrf_token : string
-
token to prevent cross site request forgeries
- $query : string
-
the current search query
- $subsearch : string
-
name of subsearch page this image group on
- $open_in_tabs : bool
-
whether new links should be opened in tabs