#Here is the header i need to inject
1 messages ยท Page 1 of 1 (latest)
Sorry did not understand
What about a change node after the cronplus node?
i want to use chronplus at specific times of hour (which regular inject can;t)
Yeah makes sense... let me try.. gimme a minute
Seems to be working ๐
how do we create these threads, while replying?
just right click like a reply and select create thread.
Hey talking of the JSON thing in Chronplus, i did not quite get it. Do you mean we can get away with change node and just enter msg.header and msg.useragent in JSON option in chron node itself?
can you copy paste me a JSOn code for it for say msg.header., i will edit it for more
Yup. In fact, if you get your change node set up the way you want, you can click copy value (via debug node) and drop the value right into the cronplus JSON payload.
I just tried it by copying my object back into the Edit JSON window.
had to help the formatting a little bit but it matched the original object that I pushed out of the node.
Dont think its correct
sorry i dont quite know the json formatting so asked for an code example, so that i can add multiple ones
I think it is definitely a start. the only thing I'm not sure how to do is get it from the msg.payload, into the msg.header. I think it needs another 'header : {' thing but I'm not sure.
@wintry swan can you jump in here and help with JSON syntax?
Ok. Here are the things i need injecting
- msg.header =en-US,en;q=0.5
- msg.User-Agent = Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/95.0
also, I think for your schedule you should be able to use 0/5 * * * *
wait no i think given i need to inject at minute 5, 10 and like that specifically and not every 5 minute (i can have connection issues in between and timings will jumble up). ELse for every 5 minute, regular inject also works ๐
I'm pretty sure that's what that will do. you will get injects at 5, 10, 15, etc. Basically minutes / 5.
Something like this?
yes
{
"header": {
"Accept-Language": "en-US,en;q=0.5",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/95.0 "
}
}```
but if chronplusnode is started at say 11:03, it will inject at 11:08, 11:13, likewise. No?
I don't believe so. it is based off of the system time; not deployment time.
interesting, let me try 0/5
cron is commonly used in Linux systems, particularly servers, to set up when tasks are to be performed.
the drop-down should tell you what you have it set as and should tell you when the next firing will occur.
(forgot cronplus allows seconds to be defined hence the preceeding 0)
A problem... header seems to be within the msg.payload and not being read by website. (unlike the change node solution we got)
change node
Think I got it fixed: JSON { "Accept-Language": "en-US,en;q=0.5", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/95.0 " }
where can i set the output.property ?
top of the cronplus node
Thanks. Looks like lot of work.
so if say i need another property in future like msg.payload too, this setup will not work. Correct?
I think change node solution is simpler for newbies like me ๐
Unfortunately, it looks like you have to set your highest level object. So it can't do msg.payload and msg.headers. But it could do msg.payload, msg.payload.headers, and msg.payload.somethingelse.
but you could just use a change node to move the msg.payload.headers to msg.headers.
and then you would have "access" to put data into the msg.payload. You'd have to go back to the original JSON where the second line was "headers": { and add an ending } to enclose it.
Ok. Thanks for all your help. I guess i will simply use the change node. But its good that you learnt too abt json from other guyand me too learnt a thing or 2 in my tiny brain..lol