aboutsummaryrefslogtreecommitdiff
path: root/bridges/DaveRamseyBlogBridge.php
blob: 1d8d549ecac1eb1c7432afd6d84dfa72e47bf3e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

class DaveRamseyBlogBridge extends BridgeAbstract {
	const MAINTAINER = 'johnpc';
	const NAME = 'Dave Ramsey Blog';
	const URI = 'https://www.daveramsey.com/blog';
	const CACHE_TIMEOUT = 7200; // 2h
	const DESCRIPTION = 'Returns blog posts from daveramsey.com';

	public function collectData()
	{
		$html = getSimpleHTMLDOM(self::URI);

		foreach ($html->find('.Post') as $element) {
			$this->items[] = array(
				'uri' => 'https://www.daveramsey.com' . $element->find('header > a', 0)->href,
				'title' => $element->find('header > h2 > a', 0)->plaintext,
				'tags' => $element->find('.Post-topic', 0)->plaintext,
				'content' => $element->find('.Post-body', 0)->plaintext,
			);
		}
	}
}