In Facebook, when we open the home page we see multiple newsfeeds. These newsfeed are updated continuously, let's try to imitate the same in R. The following code will sort the newsfeeds in an order based on the interactions, as well as the recency of publishing. If you face any problems here, check the version of the API and retry with the API of Version 2.3. The code is as follows:
newsfeed<- getNewsfeed(token, n = 200) head(newsfeed, 20) newsfeed$datetime<- format.facebook.date(newsfeed$created_time) currdate<- Sys.time() maxdiff<- max(difftime(currdate, newsfeed$datetime, units="hours")) newsfeed$priority<- maxdiff - difftime(currdate, newsfeed$datetime, units="hours") newsfeed$priority<- as.numeric(newsfeed$priority) fnpriority<- function(x){(x-min(x))/(max(x)-min(x))} newsfeed$priority<- fnpriority(newsfeed$priority) *100 newsfeed$plikes_count<- fnpriority(newsfeed$likes_count) *100 newsfeed$pcomments_count<- fnpriority...