3

I would like to run the following HTTP.GET function at a set interval (every 1 minute) until 10 minutes have passed or it has succeeded in retrieving the content.

var contentRetriever = function(){
for (var x = 1; x <= 10; x++){
        try {   
            data = HTTP.Get(feedurl);
            Variable.SetValue('RSSDATA', data.Content);
            RSSdebugDE.Rows.Add({FEED_NAME:feed,STATUS:"OK",MESSAGE:feed + ": content retrieved after " + x + " try"});
            x = 10;
        }
        catch(e){
            success = false;    
            }
        }
    if (success == false){
        RSSdebugDE.Rows.Add({FEED_NAME:feed,STATUS:"Error",MESSAGE:feed + ": content could not be retrieved after " + x + " retries"});
    }
};

I've tried using the setInterval and setTimeout functions for JS, but this only seems to apply for front end javascript?

Is it possible to use these functions in SSJS in ExactTarget? And if so, how it would work?

Thanks!

2

In order to do this, you would want to build a "middle-tier" page that does the http.get call and returns data, and then on the client side run the interval.

Think of SSJS as any other server side scripting language. Once it runs, it won't run again until it's called by the server.

1

There is a way to do this now with Script Activities in Automation Studio. SMFC support can enable them for you.

Once enabled, you can define a Script Activity in Email -> Interactions and then schedule it in Automation Studio to run on an interval.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.