I am looking for an app or a way how to automate opening a URL based on current date on the Android 7.0 phone:
On 2017-07-01 it would open the following url in a browser:
http://myserver.com/daily_reports/Day_20170701.htm
eventually
http://myserver.com/weekly_reports/Week_2017_27.htm
Since the ISO number of the current week is 27.
Is there any solution for that out of the box?
Answer
With Tasker this is very easy.
Setup a task like this:
- Code → Run Shell:
- Command:
date +"%Y%m%d"
- Store Output In:
%date
- Command:
- App → Launch App → select your browser app:
For weekly URL, create an another task:
- Code → Run Shell:
- Command:
date +"%Y_%V"
- Store Output In:
%week_no
- Command:
- App → Launch App → select your browser app:
You can save these two tasks, create a shortcut to them on your home screen and tap that shortcut to open the concerned URL. Or, you can setup a profile in Tasker for your requisite automation and attach those tasks to that.
No comments:
Post a Comment