Values in date URL - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Values in date URL (/thread-10623.html) |
Values in date URL - DrSavage - May-28-2018 Hi First time here and newbie learning Python, so hope you can help me ? This is the amended url, which works internally only and will return 5 seconds of data http://monitoring/dashboards/php/feed/liveviewership.php?graphdata=true&startday=20180415%2007:00&endday=20180415%2007:05 How can I ask the user for the startday and endday values, check its correct date and time format and use the user date/time for checking the data ? From the data returned I have to put it into fields to look for the min and max and amount of data. Any help or advice would be very gratefully received Thanks RE: Values in date URL - Larz60+ - May-28-2018 5 seconds of what? min and max of what? what are the fields? To get help, you need to help us! RE: Values in date URL - DrSavage - May-28-2018 this is a sample data
RE: Values in date URL - DrSavage - Jun-12-2018 Ive had no help or suggestions on this. Just to be clear I Was looking how I ask a user for the start date put it in startday=20180415%2007:00, checking it is a valid date and the same for endday=20180415%2007:05. So the url might look like http://monitoring/dashboards/php/feed/liveviewership.php?graphdata=true&startday=cust_startdate&endday=cust_enddate I can do the rest. Thanks RE: Values in date URL - snippsat - Jun-12-2018 >>> startday = '20180415%2007:00' >>> endday = '20180415%2007:05' >>> print(f'http://monitoring/dashboards/php/feed/liveviewership.php?graphdata=true&{startday}=cust_startdate&{endday}=cust_enddate') http://monitoring/dashboards/php/feed/liveviewership.php?graphdata=true&20180415%2007:00=cust_startdate&20180415%2007:05=cust_enddate >>> # Not using 3.6,use format() >>> print('http://monitoring/dashboards/php/feed/liveviewership.php?graphdata=true&{}=cust_startdate&{}=cust_enddate'.format(startday, endday)) http://monitoring/dashboards/php/feed/liveviewership.php?graphdata=true&20180415%2007:00=cust_startdate&20180415%2007:05=cust_enddate RE: Values in date URL - DrSavage - Jun-12-2018 thank you snippsat I will try this overnight. |