| 1 |
<?php |
| 2 |
/** |
| 3 |
* Friends Feed Parser |
| 4 |
* |
| 5 |
* This contains the reference implementation for a parser. |
| 6 |
* |
| 7 |
* @package Friends |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace Friends; |
| 11 |
|
| 12 |
/** |
| 13 |
* This class describes a friends feed parser. |
| 14 |
*/ |
| 15 |
abstract class Feed_Parser_V2 extends Feed_Parser { |
| 16 |
|
| 17 |
/** |
| 18 |
* Fetches a feed and returns the processed items. |
| 19 |
* |
| 20 |
* Return an array of objects: |
| 21 |
* |
| 22 |
* return array( |
| 23 |
* new Feed_Item array( |
| 24 |
* 'permalink' => 'https://url.of/the/feed/item', |
| 25 |
* 'title' => 'Title for the feed item', |
| 26 |
* 'content' => 'Content for the feed item', |
| 27 |
* 'date' => gmdate( 'Y-m-d H:i:s' ), |
| 28 |
* // Optional fields: |
| 29 |
* 'comment_count' => 0, |
| 30 |
* 'gravatar' => 'https://url/icon.png', |
| 31 |
* 'post_status' => 'publish', // A WordPress post status (e.g. publish or private). |
| 32 |
* 'post_id' => 123, // the id of the post for better update/duplicate detection. |
| 33 |
* 'updated_date' => gmdate( 'Y-m-d H:i:s' ), |
| 34 |
* ), |
| 35 |
* ); |
| 36 |
* |
| 37 |
* @param string $url The url. |
| 38 |
* @param User_Feed $user_feed The user feed. |
| 39 |
* |
| 40 |
* @return array An array of feed items. |
| 41 |
*/ |
| 42 |
public function fetch_feed( $url, ?User_Feed $user_feed = null ) { |
| 43 |
return array(); |
| 44 |
} |
| 45 |
} |
| 46 |
|