Skip to content

Instantly share code, notes, and snippets.

@btk
Created July 13, 2016 07:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save btk/3506d5f8525599eb6e753fbad2b2b2a2 to your computer and use it in GitHub Desktop.
Save btk/3506d5f8525599eb6e753fbad2b2b2a2 to your computer and use it in GitHub Desktop.
<?php
$rssLink = "http://forum.fitekran.com/kategori/-/index.rss"; // Your URL
$PostLimit = 8; // Limit of posts that will be crawled.
$RSSArr = json_decode(file_get_contents("http://rss2json.com/api.json?rss_url=".urlencode($rssLink)));
//Using rss2json.com API
$i = 0;
foreach($RSSArr->items as $rssFeedObj){
if($i < $PostLimit){
echo "<a href='".$rssFeedObj->link."' target='_blank'><li>".$rssFeedObj->title."</li></a>";
}else{
break;
}
$i++;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment