Hello, all.
I'm trying to do a workflow that will allow me to search Google Flights by passing multiple queries to Alfred. The URL for Google Flights looks like:
https://www.google.com/flights/#search;f=LAX;t=MAD;d=2015-06-17;r=2015-06-30
Summary: f is the outgoing airport code, t is the destination airport code, d is the departure date, and r is the return date. I've modified the Kitten image workflow I found elsewhere in the forums to try to use multiple queries, so my bash script looks like:
#!/bin/bash
# split the query into an argument array
IFS=',' read -a qarg <<< "{query}"
# set the x and y sizes from the array
w=${qarg[0]}
x=${qarg[1]}
y=${qarg[2]}
z=${qarg[3]}
# open the url with the two arguments
open "https://www.google.com/flights/#search;f=$w;t=$x;d=$y;r=$z"
When I run the script, though, it puts all the queries in for $w, and the other three don't get populated. What am I doing wrong? Any ideas? Thanks.