Last active
September 26, 2015 07:07
-
-
Save ravikiranj/1058780 to your computer and use it in GitHub Desktop.
infinite_scroll_curl_twitter_timeline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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