The rating logic structure
The initial rating logic will have three methods:
getTrends():
To fetch the latest trends from a URLrateTrends()
: To rate a particular news entry based on the trendrateDate()
: To rate a particular news entry based on its published date
First we need to fetch a list of keywords, which have been trending for the past hour. Then we need to investigate the news items and find out if any of the current trends are available in them. If the answer is yes we need to add the rank of each trend to the news. In other words, not all items in Google Trends have the same value and they are sorted by their popularity. Finally, we need to give an extra point to the news that was published in the last 24 hours. Based on this logic, create ...
Get Angular Services now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.