Need help to put conditions in parse datas



  • Hi all,

    I have parsed (regex with recursive method) the following information for an account:
    type of product
    expiration date (in unixtime)
    number of devices

    Hits = [Products: name1, Exp: 1516444893066, Devices: 1, Products: name2, Exp: 1674211292704, Devices: 1, Products: name3, Exp: 1548289653215, Devices: 1, Products: name3, Exp: 1519986378857, Devices: 1]
    
    

    I want to capture only unexpired products and transform the expiration date in unixtimetodate.

    I think I have to set a variable currentunixtime and compare with expiration date.

    I d'ont know how to do with a recursive parsing

    Thanks for your help

    Ps: I used to use the loli script



  • Hi

    Do a Function CurrentUnixTime, then make a key check
    Var Unix = your expiration date

    #FUNCTION_CurrentTime FUNCTION CurrentUnixTime -> VAR "Current" 
    
    #KEY_CHECK_(Premium) KEYCHECK BanOnToCheck=FALSE 
      KEYCHAIN Failure OR 
        KEY "<Unix>" LessThan "<Current>" 
        KEY "<Current>" EqualTo "<Unix>" 
        KEY "<Current>" GreaterThan "<Unix>" 
    


  • Arr, dident see there was more in same string



  • Hi
    thanks for your help.
    Even if I can change unitime to unixtimetoate for all expiration date I will be glad but i didn't find the solution.


Log in to reply