The system is implemented to automatically fetch Rss feed automatically at regular intervals. At the start of the system, to Go routines are started separately.
- The first go routing starts the server for searching the saved feeds
- The second is used to retrieve the feed at regular intervals and the response save in the database.
i. Mongodb database: A cloud based mongodb database was implemented with the system as it supports search and no need for installations.
This method retrieves rss feed from any url provided and return it to a channel
This methods receive information from the channel, get the array of feeds loop through and return []interface {}
It makes use of the above methods by passing multiple urls and passing the retrieved information into the channel
This is the method responsible for running the spider methods at intervals.
This is the method responsible for connecting the system to the database. A mongodb collection is returned
Saving into the database is done in this method. An unordered form of saving is used in other to allow the check on duplicated and allow the procedure to continue after the error
All tests are placed in a different package called tests. to run test use go test -v -coverpkg ./... ./...
The route for the search is "/search" The project runs on heroku on this route: https://desolate-bastion-48049.herokuapp.com
Method: POST { "topic" : "US" }