diff --git a/README.md b/README.md index 7b592483..d53bff36 100644 --- a/README.md +++ b/README.md @@ -101,28 +101,53 @@ modify the `repository` in `scalingo.json`. See https://github.com/RSS-Bridge/rs Learn more in [Installation](https://rss-bridge.github.io/rss-bridge/For_Hosts/Installation.html). -### Create a bridge +### Create a new bridge from scratch -Create the new bridge in e.g. `bridges/ExecuteBridge.php`: +Create the new bridge in e.g. `bridges/BearBlogBridge.php`: ```php posts as $post) { - $this->items[] = [ - 'uri' => sprintf('https://www.executeprogram.com/blog/%s', $post->slug), - 'title' => $post->title, - 'content' => $post->body, + // An array of dom nodes + $blogPosts = $dom->find('.blog-posts li'); + + foreach ($blogPosts as $blogPost) { + // Select the anchor at index 0 (the first anchor found) + $a = $blogPost->find('a', 0); + + // Select the inner text of the anchor + $title = $a->innertext; + + // Select the href attribute of the anchor + $url = $a->href; + + // Select the