Tuesday, September 16, 2014

applications - App that would open a url based on the current date in a browser


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:



  1. Code → Run Shell:

    • Command: date +"%Y%m%d"

    • Store Output In: %date



  2. App → Launch App → select your browser app:




For weekly URL, create an another task:



  1. Code → Run Shell:

    • Command: date +"%Y_%V"

    • Store Output In: %week_no




  2. 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

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...