0

i dunno how to put it. Hope the title is right for my problem or scenario.

I want to build a REST API, with a data coming from many rssfeed web. Right now, i'm able to fetch the data using a script javascript and saving it in my database. To be able fetch that data, i have to open a page so the script will be able to run and reload every 1 minute. The Rest Api is still in localhost by the way.

The Question is, what if i want to host it, should i have 1 PC to always running 24 hours which only open a browser and access a REST API address so the script will keep running and the data will always be up to date?

Right now this the only method in my head, is there any method that i shouldn't have 1 pc to running 24hours a day seven days a week.

Avian Driyanto
  • 93
  • 2
  • 11
  • Are you planning to deploy your service on any server? Like Node.js or Apache or Tomcat? The best solution of your problem is to setup a scheduler that will be running on a predefined period, and fetch the data and store it in DB internally and you don't need to open a page to do that if you are not modifying the response returned from rssfeed. – darshgohel May 20 '16 at 07:24
  • yeah i have a plan to do that in the future, right now is still on the localhost. Can you give me a litle more example? i still don't get it, – Avian Driyanto May 20 '16 at 07:35
  • You can go through this, [Post](http://stackoverflow.com/questions/20393613/open-source-job-scheduler-with-rest-api) , [Tutorial](https://github.com/martijnboland/appoints-api-node), [Node-Schedule](https://www.npmjs.com/package/node-schedule), [Parse](https://parse.com/docs/rest/guide). These are some of the example which you can use based on your requirements – darshgohel May 20 '16 at 08:02
  • thanks dude for your information, – Avian Driyanto May 20 '16 at 08:08

1 Answers1

0

The best solution of your problem is to setup a scheduler that will be running on a predefined period, and fetch the data and store it in DB internally and you don't need to open a page to do that if you are not modifying the response returned from rssfeed.

You can go through this, Post , Tutorial, Node-Schedule, Parse. These are some of the example which you can use based on your requirements

Community
  • 1
  • 1
darshgohel
  • 382
  • 2
  • 13