Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $feed = file_get_contents('http://blog.everybodyedits.com/feed/'); // Get feed from blog
- $rss = simplexml_load_string($feed); // PHPify it with black magic
- $title = $rss->channel->item->title."<br />\n"; // Get the title
- $rawpost = $rss->channel->item->children('content', true)->encoded."\n"; // Get the whole post
- $comments = strrpos($rawpost, '<a rel="nofollow"'); // Find where the comments button begins. This works because it's the only nofollow link in the post.
- $post = substr($rawpost, 0, $comments); // Get the part of the post starting from the beginning until the start of the comments button.
- echo $title."\n";
- echo $post."\n";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement