#!/usr/bin/env python3 # http://inamidst.com/saxo/ # Created by Sean B. Palmer import json import re import subprocess import urllib.parse import saxo def ajax(arg): if not arg: return "Search for a query on Google (Ajax)" arg = urllib.parse.quote(arg) page = saxo.request("https://ajax.googleapis.com/ajax/services/search/web", query={"v": "1.0", "q": arg}, modern=True) data = json.loads(page["text"]) return data["responseData"]["results"][0]["url"] def bing(arg): return saxo.call("bing", arg) def duck(arg): return saxo.call("duck", arg) def tor(arg): return saxo.call("gtor", arg) def web(arg): if not arg: return "Search for a phrase on Google (Web)" page = saxo.request("https://www.google.com/search", query={"q": arg}, modern=True) r_url = re.compile(r'(?ims)class="r".*?