hi guys
this are the visiting hours the weird thing is in the html the times start from 07:00
{"maximumCapacity":3,"bookings":2,"availableCapacity":1,"startTimeslot":"2021-07-25T05:00:00Z","hasAvailability":true},
but when i parse this from the response it start from 5
is there a way to add two to every value so that the times are matching
Ruri
July 23, 2021, 4:58pm
2
It’s probably because of timezones. You could do some parse + compute + replace in a loop but it’s not going to be too easy to do.
is there a way to change the timezone in my get request or is it based on ip
Ruri
July 23, 2021, 6:02pm
4
Honestly I don’t know, it depends on the website.
@Ruri my dude i really need to change the values
"2021-07-25T05:00:00Z"
to
"2021-07-25T07:00:00Z"
i’m requesting the values from the countrys ip so that aint it
You selected 7, it shows u 2 hours earlier: 5.
How about trying select 9, so it shows u 7?
thanks for the tip but that aint the problem the problem is that on the site it shows this:
but in the response it shows this
and you are trying to do what? parse something? what exactly you want to parse
root
July 25, 2021, 6:48pm
9
SEND WEBSITE LINK MAY I TRY DOD SOME THING ITS LOOK LIKE IT WILL BE GREAT FUN FOR ME
1 Like
I’m trying to parse the opening hours and see if they have booking available
The site is afspraak.testenvoorjereis.nl
And thanks for the help btw
(Ps. Am I allowed to send the config so you guys can have a look)
So I personally would do it the hard way and only way I know right now and PARSE 22 things in total.
LEFT STRING would be
“startTimeslot”:“YYYY-MM-DDTHH:MM:SSZ”,“hasAvailability”:false},{maximumCapacity":3,
(ofcourse just copy paste the LEFT STRING always from every line from the site, so the time is included.)
and RIGHT STRING
,“startTimeslot”
This would also always show you the bookings, if thats not a problem for you.
EDIT:
This will show you the Available Capacity instead of Availability, but i think thats better no?
1 Like
I could try and make the config for you, but once I enter the site i have to enter some data, maybe specific stuff would be better
1 Like
yes sure if we all use PCR Date:31-07-2021 time: 20:00 location: alphen aan den rijn second Date:30-07-2021
i already have the whole conf
nieuw conf test (3).opk (14.1 KB)
If you want to know which time slots are available.
Here you go -
(this code is from after the http request)
(the list u want is @availableTime )
BLOCK:Parse
input = @data.SOURCE
leftDelim = "tartTimeslot\":\""
rightDelim = "},"
RECURSIVE
MODE:LR
=> VAR @listt
ENDBLOCK
BLOCK:ConstantList
value = []
=> VAR @constantListOutput
ENDBLOCK
BLOCK:ConstantList
value = []
=> VAR @constantListOutput1
ENDBLOCK
BLOCK:ConstantList
value = []
=> VAR @availableTime
ENDBLOCK
FOREACH ok IN listt
BLOCK:Substring
input = @ok
index = 40
length = 1
=> VAR @substringOutput
ENDBLOCK
IF STRINGKEY @substringOutput Contains "t"
BLOCK:Substring
input = @ok
index = 11
length = 5
=> VAR @substringOutput1
ENDBLOCK
BLOCK:AddToList
list = @constantListOutput
item = @substringOutput1
ENDBLOCK
END
END
FOREACH oli IN constantListOutput
BLOCK:Substring
input = @oli
length = 2
=> VAR @substringOutput2
ENDBLOCK
BLOCK:Compute
input = $"<substringOutput2>+2"
=> VAR @computeOutput
ENDBLOCK
BLOCK:RegexReplace
original = @oli
pattern = "^.."
replacement = @computeOutput
=> VAR @regexReplaceOutput
ENDBLOCK
BLOCK:AddToList
list = @availableTime
item = @regexReplaceOutput
ENDBLOCK
END
2 Likes
@thelurker thanks my guy appreciate it!
3180 ms
My code is not perfect and inefficient ik, but it works and took me a lot of time so its good enough.
Plus the purpose for which u r using it doesnt really require u to run the config again and again so seems fine hehe
@thelurker
have to run the config again and again but this is the only way right now thank u so much
and is there a way i can just add 2 hours to all the values because my idea was to paste them in excel like this: