Collect https address

Hello , i use node python to launch a progamm wich create a unique HTTP each time i launch it. i would like to collect only The last link or better launch it directly. thanks a lot How can i do ?

Why don't you just generate the URL in node-red and miss out the python part altogether?

Secondly, if you must call python, are you able to modify it to send the data in JSON format?

Lastly, if you have no other options, use regex to extract the URL from that string.

Ps, it's not 100% clear what is generating that string as you haven't attached a debug node to the python node - so some of what I've said is speculation.

This created link download data from web and i Have to create a new one watch time
I will try what you say after my day work
I think json can be a good thing but i dont know how to use very well for the moment

i can take only the link in msg.payload but how can i execute it to receive data from this link

Use a http request node.

The cookbook has lots of examples. Work through them and you get your data in no time

I have closed your second thread. Please don't start new topics on the same subject.

sorry for double post i thought that was a little bit different
i tried with http response but in debug i have " no reponse object"
without http response python node send me the link in debug" it's the secure link i m waiting for https://api.weatherlink.com/v2/current/90419?api-key=ajmnxiysttgggzjwkxj6ajghlngti1xe&api-signature=d16dfc15836f22fe023d546b24fc6a495c69bc3dd358c94e332d210010336862&t=1590604921"
This link must be open to see all the values from my weather stations here's a little exemple of what i want.
So do you think it's possible ? i look http cookbook but i' m a basic users and i don't really understant how to do that. Can you help me ?
thanks a lot

{"sensors":[{"lsid":314240,"data":[{"rx_state":0,"wind_speed_hi_last_2_min":2,"hum":42.7,"wind_dir_at_hi_speed_last_10_min":9,"wind_chill":67.5,"rain

Change the debug node - set to show complete message.

Expand all properties. What do you see?

Hello, here's what i see

{"payload":"https://api.weatherlink.com/v2/current/90419?api-key=ajmnxiysttgggzjwkxj6ajghlngti1xe&api-signature=259367c298696e63f8bc79e939a8beef7cb0a1ac9110493e287da3483a9064d4&t=1590674008","_msgid":"4eeb27f5.828708"}

and heres the value if open the link in a browser

"sensors":[{"lsid":314240,"data":[{"rx_state":0,"wind_speed_hi_last_2_min":10,"hum":36.4,"wind_dir_at_hi_speed_last_10_min":27,"wind_chill":79.8,"rain_rate_hi_last_15_min_clicks":0,"thw_index":78.4,"wind_dir_scalar_avg_last_10_min":9,"rain_size":2,"uv_index":null,"wind_speed_last":4,"rainfall_last_60_min_clicks":0,"wet_bulb":57.6,"rainfall_monthly_clicks":30,"wind_speed_avg_last_10_min":5.75,"wind_dir_at_hi_speed_last_2_min":25,"rainfall_daily_in":0,"wind_dir_last":311,"rainfall_daily_mm":0,"rain_storm_last_clicks":null,"tx_id":1,"rain_storm_last_start_at":null,"rain_rate_hi_clicks":0,"rainfall_last_15_min_in":0,"rainfall_daily_clicks":0,"dew_point":50.8,"rainfall_last_15_min_mm":0,"rain_rate_hi_in":0,"rain_storm_clicks":30,"rain_rate_hi_mm":0,"rainfall_year_clicks":30,"rain_storm_in":0.23622048,"rain_storm_last_end_at":null,"rain_storm_mm":6,"wind_dir_scalar_avg_last_2_min":10,"heat_index":78.4,"rainfall_last_24_hr_in":null,"rainfall_last_60_min_mm":0,"trans_battery_flag":0,"rainfall_last_60_min_in":0,"rain_storm_start_time":1590219480,"rainfall_last_24_hr_mm":null,"rainfall_year_in":0.23622048,"wind_speed_hi_last_10_min":13,"rainfall_last_15_min_clicks":0,"rainfall_year_mm":6,"wind_dir_scalar_avg_last_1_min":2,"temp":79.8,"wind_speed_avg_last_2_min":6.18,"solar_rad":null,"rainfall_monthly_mm":6,"rain_storm_last_mm":null,"wind_speed_avg_last_1_min":5.62,"thsw_index":null,"rainfall_monthly_in":0.23622048,"rain_rate_last_mm":0,"rain_rate_last_clicks":0,"rainfall_last_24_hr_clicks":null,"rain_storm_last_in":null,"rain_rate_last_in":0,"rain_rate_hi_last_15_min_mm":0,"rain_rate_hi_last_15_min_in":0,"ts":1590674135}],"sensor_type":43,"data_structure_type":10},{"lsid":314237,"data":[{"battery_voltage":90,"ip_v4_gateway":"192.168.0.254","rapid_records_sent":2077,"firmware_version":1586914793,"uptime":597534,"touchpad_wakeups":16,"ip_v4_address":"192.168.0.7","bootloader_version":1550707628,"local_api_queries":36,"rx_bytes":11775324,"health_version":1,"radio_version":621020416,"espressif_version":1534381024,"ip_address_type":1,"link_uptime":597516,"network_type":2,"input_voltage":4683,"tx_bytes":2506267,"ts":1590673500}],"sensor_type":504,"data_structure_type":15},{"lsid":314238,"data":[{"bar_absolute":29.096,"bar_sea_level":30.267,"bar_offset":-0.001,"bar_trend":-0.046,"ts":1590674135}],"sensor_type":242,"data_structure_type":12},{"lsid":314239,"data":[{"temp_in":88.1,"heat_index_in":86.2,"dew_point_in":53.3,"ts":1590674135,"hum_in":30.5}],"sensor_type":243,"data_structure_type":12}],"generated_at":1590674194,"station_id":90419}

That doesn't look anything like the output of a http request node. Nor doe it look like you have set show full message.

Show a screenshot shot of your flow and the debug output from into and out of the http request.

@Steve-Mcl I think you've misinterpreted what you're being shown.

This is the message being received that contains the url to get. The question is how to do that.

@mykerinos1 You say you've tried with the HTTP Response node - that is not the right node to use. You should use the HTTP Request node. That node will make an http request to the url provided in msg.url. So you will need to add a Change node to move msg.payload to msg.url.

@Steve-Mcl
iin fact i tried with http response so i changed it with http request here's my flow i don't know how send my url to the http request as @knolleary said
i put a change function node but i don't know how to set

At the moment, the url you have is in msg.payload. You need it to be in msg.url before you pass it to the HTTP Request node.

Add a Change node before the HTTP Request node. Configure it to move msg.payload to msg.url.

i do that but http request said there's no url link

Change the set option to move

1 Like

It works !!!! :grin:

Thanks a lot .thanks also to @Steve-Mcl for your help

Another one stumped by the change node.

A few threads I've seen lately lead me to think Copy might be more appropriate than Set (translates better (see the German issue where it reads as Until),. I feel Copy is a bit clearer and as a bonus, the 2 fields would remain in the same place when you switch between Move and Copy mode)

(Not the place to discuss this I know - but contextually related)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.