Jump to content

Tutorial: Build Your Own: Google as You Type


Recommended Posts

Posted

@Alfred0 gmap is same as the one shown in tutorial, but just with the URL change

q="$1"

function urlencode {
  echo -n "$1" \
   | /usr/bin/python3 -c "import sys, urllib.parse; print(urllib.parse.quote_plus(sys.stdin.read()),end='')"
}

url_q=$(urlencode "$1")

cat << EOF
{"items" : [
  {"title": "Search $q",
   "subtitle": "using maps.google.com",
   "arg": "https://www.google.com/maps?q=$url_q",
   "quicklookurl": "https://www.google.com/maps?q=$url_q"}
]}
EOF

 

Posted

This is super cool @Mr Pennyworth! Thanks for the great tutorial.

 

One question – I've noticed that the app rapidly consumes memory in a short amount of time. Besides restarting the app, would there be another way to have it free up the memory once it's no longer in use (i.e. after I've navigated out of the workflow that activated AlfredExtraPane in the first place)?

 

image.png.6dc49e3886c6bbbc2d44e8e714d4fe9f.png

Posted

@dood thanks for flagging the issue!

unfortunately, no ways to do that currently.

I'll have to learn more about swift, webviews, and macOS app programming and debugging in general to get to it, so the fix could be far away :(

unless, of course, someone sends a pull request 😇

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...