I created an react native expo app which can fetch and show rss feed data
Suppose on this site https://www.drive.com.au/news/ there are almost 30 posts and show more option but when I fetch the rss feed using this link https://www.drive.com.au/feed/ I got only 10 items. Why I’m not getting all the posts and is there any way to get more posts ?
My function looks like this :
// Function to fetch RSS Feed
const fetchRSSFeed = async (
url: string,
setFeedData: React.Dispatch<React.SetStateAction<FeedItem[]>>,
setLoading: React.Dispatch<React.SetStateAction<boolean>>
) => {
setLoading(true);
try {
const response = await axios.get(url);
const parser = new xml2js.Parser();
parser.parseString(response.data, (err: any, result: any) => {
if (err) {
console.error("Error parsing XML:", err);
setLoading(false);
return;
}
const items: FeedItem[] = result?.rss?.channel[0]?.item || [];
setFeedData((prevItems) => [...prevItems, ...items]); // Add new feed items to the list
setLoading(false);
});
} catch (error) {
console.error("Error fetching RSS feed:", error);
setLoading(false);
}
};
I tried to look for pagination information on the rss feed but no luck