Frage

I want to write a function in Parse clod code that periodically reads an XML file and checks whether there is a new entry and does something if there is.

The main question:
1. Where do I write the logic/function to do this. If it is a function, where is it called?

On a side note:
2. Is it possible to store variables in Parse cloud code? To be more precise, can I read an xml file the first time and store the title, then on the second read check the title against the title from the previous read?

War es hilfreich?

Lösung

Well, I asked this yesterday and never got an answer. Solved it myself eventually so i'll jus tout an answer here for completeness sake. If anyone else has a better idea, add that too.

For the first question:

-Write a cloud function in {Cloud code folder name}/cloud/main.js to parse xml.

-Write a background job in the same js file to call the function above.

-In your parse.com dashboard for the app, set the schedule details of the job under the Cloud code section.

For the second question:

Global variables can't be used in Parse.com cloud code. Instead store these variables in a Parse class (table) and access it from your client and/or cloud side.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top