Created
January 26, 2022 14:57
-
-
Save Aikufurr/76a5b68ff0bc2f3c17081512155adf63 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import json | |
import sys | |
output = subprocess.Popen(["curl", "-s", "-L", "http://suggestqueries.google.com/complete/search?client=firefox&q=" + sys.argv[1]], stdout=subprocess.PIPE).communicate()[0] | |
l = json.loads(output)[1] | |
for i,e in enumerate(l): | |
print(str(i) + ": " + e) | |
i = input("> ") | |
p = subprocess.Popen(["xsel", "-bi"], stdin=subprocess.PIPE) | |
p.communicate(input=l[int(i)].encode()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment