you can use Connect in Apex feature for your requirement.To help you start with below article is a great resource
https://developer.salesforce.com/blogs/developer-relations/2013/02/getting-started-with-connect-in-apex.html
Lets replicate some code for reference in case our links break in future
global List<FeedItemInfo> getFeedItems() {
ConnectApi.FeedItemPage feedPage = getFeed();
List<FeedItemInfo> result = new List<FeedItemInfo>();
for (ConnectApi.FeedItem item : feedPage.items) {
result.add(new FeedItemInfo(item));
}
return result;
}
Visualforce code
<apex:page>
<apex:repeat value="{!feedItems}" var="feedItemInfo">
<div class="feedItemOuterDiv">
<div class="feedItemInnerDiv">
<div class="feedPhotoDiv">
<apex:image class="imageMargin" width="25" url="{!feedItemInfo.feedItem.photoUrl}"/>
</div>
<div class="feedItemBodyDiv">
<b>{!feedItemInfo.userName}</b><br/>
<apex:outputText value="{!feedItemInfo.formattedText}" escape="false"/>
</div>
<apex:outputPanel rendered="{!IF(feedItemInfo.imageUrl == null, false, true)}" >
<div class="feedImageDiv" >
<apex:image class="imageMargin" width="100" url="{!feedItemInfo.imageUrl}"/>
</div>
</apex:outputPanel>
</div>
<apex:outputPanel rendered="{!IF(feedItemInfo.comments.size > 0, true, false)}">
<div class="feedCommentOuterDiv">
<apex:repeat value="{!feedItemInfo.comments}" var="commentInfo">
<div class="feedCommentInnerDiv">
<div class="feedPhotoDiv">
<apex:image class="imageMargin" width="25" url="{!commentInfo.comment.user.photo.smallPhotoUrl}"/>
</div>
<div class="FeedCommentBodyDiv">
<b>{!commentInfo.userName}</b><br/>
<apex:outputText value="{!commentInfo.formattedText}" escape="false"/>
</div>
<apex:outputPanel rendered="{!IF(commentInfo.imageUrl == null, false, true)}" >
<div class="feedImageDiv" >
<apex:image class="imageMargin" width="100" url="{!commentInfo.imageUrl}"/>
</div>
<div style="clear: both;"/>
</apex:outputPanel>
</div>
</apex:repeat>
</div>
</apex:outputPanel>
</div>
</apex:repeat>
</apex:page>