-
I'm interested in creating a new bridge (for ssrn.com, specifically). I've read the documentation and have looked at some example bridges, but I'm still fundamentally not sure where to get started. I don't have a good understanding of rss-bridge actually works under the hood. E.g., how does it crawl the website to find new posts (to then process into an RSS feed)? This is clearly a very basic question, but I can't seem to find enough of an answer to give me the conceptual overview I need to start hacking on a new bridge. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You have to manually scrape and parse out items. Not much automatic here. Example: <?php
class BearBlogBridge extends BridgeAbstract
{
const NAME = 'BearBlog (bearblog.dev)';
public function collectData()
{
$dom = getSimpleHTMLDOM('https://herman.bearblog.dev/blog/');
foreach ($dom->find('.blog-posts li') as $li) {
$a = $li->find('a', 0);
$this->items[] = [
'title' => $a->plaintext,
'uri' => 'https://herman.bearblog.dev' . $a->href,
];
}
}
} You also need to learn css-style traversing of the DOM. Example: |
Beta Was this translation helpful? Give feedback.
You have to manually scrape and parse out items. Not much automatic here. Example:
You also need to learn css-style traversing of the DOM. Example:
$dom->find('div.items > item > p')