Skip to content

Instantly share code, notes, and snippets.

@ravikiranj
Last active September 26, 2015 07:07
Show Gist options
  • Save ravikiranj/1058780 to your computer and use it in GitHub Desktop.
Save ravikiranj/1058780 to your computer and use it in GitHub Desktop.
infinite_scroll_curl_twitter_timeline
<?php
/**
* Function to get RSS Feed Items
*
* @param String $user, Integer $page
* @return object response
*/
function getRSSFeedItems($limit, $offset) {
$baseURL = "http://query.yahooapis.com/v1/public/yql?";
$query = "select title,link,pubDate from rss where url='http://rss.news.yahoo.com/rss/topstories' limit ${limit} offset {$offset}";
$url = $baseURL . "format=json&q=" . urlencode($query);
$session = curl_init($url);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($session);
curl_close($session);
return json_decode($json, true);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment