How to determine most shared links


i have a question,
how would i be able to determine the most shared links on twitter, for example one method i was thinking was to get all trends and do a search for that trend returning all links and then counting the links and ranking them,

this website display news based on shares from twitter and Facebook, but i would just link to understand a high level overview of how this would work accordingly