Jump to content

warrenbuckley

Member
  • Posts

    5
  • Joined

  • Last visited

Everything posted by warrenbuckley

  1. Hello Deanishe, I have gone with your approach and created 4 script filters instead. I only know NodeJS & C# so can't write it in PHP hence I have BASH just do a CURL to an Azure Function (Same as WebTask.io) a NodeJS bit of code to do what I need & return the JSON back for Alfred. This is the best solution for me for now, rather than doing anymore logic by using a single script filter and checking for spaces to split on.
  2. Hi Andrew, Thanks for the response. Shame I cannot do something with the visual workflow builder tools in Alfred itself. Just means that my hosted NodeJS API on WebTask.io or Azure Functions will require a fair bit more logic to check for the number of words by splitting on a space or similar to show the first four items if we only have one part and then as soon as we have two words items in the array when splitting the string with a space I can assume the remaining text is the search query. Thanks again for the pointer, I will go back to hacking something. Cheers, Warren
  3. I am in the process of creating an Alfred 3 workflow that uses a list filter option and the chosen option is passed into the script filter So typing the first keyword umb triggers the list filter, where the user can choose from all, forum, documentation or packages After choosing this option the user presses enter and then types in their search query which passes the query into the script filter which queries an API using a CURL script with BASH to return JSON What I would like to achieve is the following, that a user types in umb forum followed immediately by the search query so umb forum inserting images so this allows users to choose what Here is a quick gif of what I am trying to describe http://cl.ly/061V3L3p2v0w Current Workflow, if anyone is able to download it & provide any help or pointers would be fantastic http://cl.ly/0k0l1f441f2s Cheers, Warren
  4. Update for anyone else reading this. I resolved it by manually replacing spaces with 20% with the following below #The base URL moved away from WebTask.io to Azure Functions baseurl='https://umbraco-alfred.azurewebsites.net/api/OurUmbNodeJS?' #The Type QS parameter typeparam='type=' #The Query QS parameter queryparam='&query=' #The Search query parameter from the last alfred workflow question query=$1 #Replace spaces in the query with 20% to url-encode it query=${query// /%20} #Concact the URL fullurl=$baseurl$typeparam$searchtype$queryparam$query #make the request with curl curl $fullurl #curl example with get #curl -G -v $baseurl --data-urlencode $typeparam$searchtype --data-urlencode $queryparam$query
  5. Hello all, i am building my first custom workflow that queries an API to display results in the auto-suggest dropdown and returns the new JSON format for Alfred3 workflows. This works perfectly fine in the query is a single word, but if the query is multiple words then only the first word is sent as part of the querystring. So is there a way to do a cURL request with this query containing spaces? My current bash script in the list filter looks like so: #The base URL moved away from WebTask.io to Azure Functions baseurl='https://umbraco-alfred.azurewebsites.net/api/OurUmbNodeJS' #The Type QS parameter typeparam='type=' #The Query QS parameter queryparam='query=' #The Search query parameter from the last alfred workflow question query=$1 #Concact the URL fullurl=$baseurl$typeparam$searchtype$queryparam$query #What I had originally building up the string to do a curl on #curl fullurl #Even tried this with no luck curl -G -v $baseurl --data-urlencode --data-urlencode $typeparam$searchtype --data-urlencode $queryparam$query
×
×
  • Create New...