mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 11:46:30 +02:00
Pack python env to zip
This commit is contained in:
@@ -8,15 +8,20 @@ from wox import Wox,WoxAPI
|
||||
class HackerNews(Wox):
|
||||
|
||||
def query(self,key):
|
||||
r = requests.get('https://news.ycombinator.com/')
|
||||
proxies = {}
|
||||
if self.proxy and self.proxy.get("enabled") and self.proxy.get("server"):
|
||||
proxies = {
|
||||
"http": "http://{}:{}".format(self.proxy.get("server"),self.proxy.get("port")),
|
||||
"http": "https://{}:{}".format(self.proxy.get("server"),self.proxy.get("port"))
|
||||
}
|
||||
#self.debug(proxies)
|
||||
r = requests.get('https://news.ycombinator.com/',proxies = proxies)
|
||||
bs = BeautifulSoup(r.text)
|
||||
results = []
|
||||
for i in bs.select(".comhead"):
|
||||
title = i.previous_sibling.text
|
||||
url = i.previous_sibling["href"]
|
||||
#results.append({"Title": title ,"IcoPath":"Images/app.ico","JsonRPCAction":{"method": "Wox.ChangeQuery","parameters":[url,True]}})
|
||||
results.append({"Title": title ,"IcoPath":"Images/app.ico","JsonRPCAction":{"method": "openUrl","parameters":[url],"dontHideAfterAction":True}})
|
||||
#results.append({"Title": title ,"IcoPath":"Images/app.ico","JsonRPCAction":{"method": "Wox.ShowApp"}})
|
||||
|
||||
return results
|
||||
|
||||
|
||||
Reference in New Issue
Block a user