ShareShortcuts

Business Days Until Date

rasmus-lo
Bifurcar “Business Days Until Date”

¿Creaste algo nuevo a partir de este atajo? Compártelo como bifurcación: se convierte en un atajo tuyo, que tú administras, y ambas páginas se enlazan entre sí para que rasmus-lo reciba el crédito.

  1. 1Obtén el atajo y modifícalo en la app Atajos. Ponle un nombre propio.
  2. 2Compártelo desde la app Atajos y copia el enlace de iCloud.
  3. 3Vuelve aquí, pega el enlace y describe qué es diferente, p. ej., “Se añadió un paso que usa Apple Intelligence para personalizar el texto”.
Descargas
73K
Guardado
0
Acciones
24
Categoría
API
Versión
1.0
Idioma
EN

WolframAlpha - # of business days until a future date

Return the number of business days from now until a future date


The shortcut calculates the number of working days until a future date using the WolframAlpha API.

You'll first need to sign up for your own API key before installing the shortcut:

https://products.wolframalpha.com/api/

Novedades

Versión 1.0

First release

Historial de versiones
1.0 4 de nov. de 2018

First release

Qué hace

24 acciones
  1. Text
  2. Comment
    You will need to sign up for your personal API key at https://products.wolframalpha.com/api/ Enter your API key below:
  3. Text
  4. Set Variable
    api_key
  5. Text
  6. Set Variable
    jsonpath_query
  7. Ask for Input
    What is the future date?
  8. Format Date
  9. Set Variable
    date
  10. Text
  11. URL Encode
  12. Text
  13. Get Contents of URL
  14. Get Text from Input
  15. Set Variable
    json_result
  16. Text
  17. Set Variable
    jsonpath_script
  18. Text
  19. Base64 Encode
  20. URL
    data:text/html;base64,…
  21. Get Contents of Web Page
  22. Get Text from Input
  23. Set Variable
    result
  24. Show Result

Ver como código
Beta

Todas las acciones de este atajo escritas en Cherri, un lenguaje de programación para Atajos. Ideal para aprender cómo funciona.

#include 'actions/web'
#include 'actions/calendar'
#define color red
#define glyph calendar

/*
You will need to sign up for your personal API key at https://products.wolframalpha.com/api/

Enter your API key below:
*/
@api_key = "nil"
@jsonpath_query = "$..pods[?(@.scanner == 'Identity')].subpods[?(@.primary == true)].plaintext"
prompt("What is the future date?", "Date")
formatTimestamp("", "Long", "None")
@date = nil
urlEncode("")
downloadURL("")
getText(nil)
@json_result = nil
@jsonpath_script = "/* JSONPath 0.8.0 - XPath for JSON\n *\n * Copyright (c) 2007 Stefan Goessner (goessner.net)\n * Licensed under the MIT (MIT-LICENSE.txt) licence.\n */\nfunction jsonPath(obj, expr, arg) {\n   var P = {\n      resultType: arg && arg.resultType || \\"VALUE\\",\n      result: [],\n      normalize: function(expr) {\n         var subx = [];\n         return expr.replace(/[\['](\??\(.*?\))[\]']/g, function($0,$1){return \\"[#\\"+(subx.push($1)-1)+\\"]\\";})\n                    .replace(/'?\.'?|\['?/g, \\";\\")\n                    .replace(/;;;|;;/g, \\";..;\\")\n                    .replace(/;$|'?\]|'$/g, \\"\\")\n                    .replace(/#([0-9]+)/g, function($0,$1){return subx[$1];});\n      },\n      asPath: function(path) {\n         var x = path.split(\\";\\"), p = \\"$\\";\n         for (var i=1,n=x.length; i<n; i++)\n            p += /^[0-9*]+$/.test(x[i]) ? (\\"[\\"+x[i]+\\"]\\") : (\\"['\\"+x[i]+\\"']\\");\n         return p;\n      },\n      store: function(p, v) {\n         if (p) P.result[P.result.length] = P.resultType == \\"PATH\\" ? P.asPath(p) : v;\n         return !!p;\n      },\n      trace: function(expr, val, path) {\n         if (expr) {\n            var x = expr.split(\\";\\"), loc = x.shift();\n            x = x.join(\\";\\");\n            if (val && val.hasOwnProperty(loc))\n               P.trace(x, val[loc], path + \\";\\" + loc);\n            else if (loc === \\"*\\")\n               P.walk(loc, x, val, path, function(m,l,x,v,p) { P.trace(m+\\";\\"+x,v,p); });\n            else if (loc === \\"..\\") {\n               P.trace(x, val, path);\n               P.walk(loc, x, val, path, function(m,l,x,v,p) { typeof v[m] === \\"object\\" && P.trace(\\"..;\\"+x,v[m],p+\\";\\"+m); });\n            }\n            else if (/,/.test(loc)) { // [name1,name2,...]\n               for (var s=loc.split(/'?,'?/),i=0,n=s.length; i<n; i++)\n                  P.trace(s[i]+\\";\\"+x, val, path);\n            }\n            else if (/^\(.*?\)$/.test(loc)) // [(expr)]\n               P.trace(P.eval(loc, val, path.substr(path.lastIndexOf(\\";\\")+1))+\\";\\"+x, val, path);\n            else if (/^\?\(.*?\)$/.test(loc)) // [?(expr)]\n               P.walk(loc, x, val, path, function(m,l,x,v,p) { if (P.eval(l.replace(/^\?\((.*?)\)$/,\\"$1\\"),v[m],m)) P.trace(m+\\";\\"+x,v,p); });\n            else if (/^(-?[0-9]*):(-?[0-9]*):?([0-9]*)$/.test(loc)) // [start:end:step]  phyton slice syntax\n               P.slice(loc, x, val, path);\n         }\n         else\n            P.store(path, val);\n      },\n      walk: function(loc, expr, val, path, f) {\n         if (val instanceof Array) {\n            for (var i=0,n=val.length; i<n; i++)\n               if (i in val)\n                  f(i,loc,expr,val,path);\n         }\n         else if (typeof val === \\"object\\") {\n            for (var m in val)\n               if (val.hasOwnProperty(m))\n                  f(m,loc,expr,val,path);\n         }\n      },\n      slice: function(loc, expr, val, path) {\n         if (val instanceof Array) {\n            var len=val.length, start=0, end=len, step=1;\n            loc.replace(/^(-?[0-9]*):(-?[0-9]*):?(-?[0-9]*)$/g, function($0,$1,$2,$3){start=parseInt($1||start);end=parseInt($2||end);step=parseInt($3||step);});\n            start = (start < 0) ? Math.max(0,start+len) : Math.min(len,start);\n            end   = (end < 0)   ? Math.max(0,end+len)   : Math.min(len,end);\n            for (var i=start; i<end; i+=step)\n               P.trace(i+\\";\\"+expr, val, path);\n         }\n      },\n      eval: function(x, _v, _vname) {\n         try { return $ && _v && eval(x.replace(/@/g, \\"_v\\")); }\n         catch(e) { throw new SyntaxError(\\"jsonPath: \\" + e.message + \\": \\" + x.replace(/@/g, \\"_v\\").replace(/\^/g, \\"_a\\")); }\n      }\n   };\n\n   var $ = obj;\n   if (expr && obj && (P.resultType == \\"VALUE\\" || P.resultType == \\"PATH\\")) {\n      P.trace(P.normalize(expr).replace(/^\$;/,\\"\\"), obj, \\"$\\");\n      return P.result.length ? P.result : false;\n   }\n} "
base64Encode(nil)
url("data:text/html;base64,{}")
getWebpageContents("")
getText(nil)
@result = nil
show("There are {@result} until {@date}")
Abrir en Cherri Playground Descompilado con cherri 2.3.0 (GPL-2.0). Puede que necesite pequeños ajustes antes de compilarse.

Valoraciones y reseñas

Escribe una reseña
–
de 5
★★★★★
★★★★
★★★
★★
★
0 ratings

Aún no hay reseñas. ¡Sé el primero en compartir tu opinión!

Publicidad

Más de rasmus-lo

Ver todo

También te puede gustar

Ver todo
Publicidad