mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
Fix mouse click issues and add a new hotmovie plugin.
This commit is contained in:
BIN
Plugins/Wox.Plugin.HotMovies/Images/movies.png
Normal file
BIN
Plugins/Wox.Plugin.HotMovies/Images/movies.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
29
Plugins/Wox.Plugin.HotMovies/main.py
Normal file
29
Plugins/Wox.Plugin.HotMovies/main.py
Normal file
@@ -0,0 +1,29 @@
|
||||
#encoding=utf8
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
import json
|
||||
import webbrowser
|
||||
|
||||
def safeSelectText(s,path):
|
||||
return s.select(path)[0].text if len(s.select(path)) > 0 else ""
|
||||
|
||||
def query(key):
|
||||
r = requests.get('http://www.gewara.com/movie/searchMovie.xhtml')
|
||||
bs = BeautifulSoup(r.text)
|
||||
results = []
|
||||
for i in bs.select(".ui_left .ui_media"):
|
||||
res = {}
|
||||
score = safeSelectText(i,".grade sub") + safeSelectText(i,".grade sup")
|
||||
res["Title"] = safeSelectText(i,".title a") + " / " + score
|
||||
res["SubTitle"] = i.select(".ui_text p")[1].text
|
||||
res["ActionName"] = "openUrl"
|
||||
res["IcoPath"] = "Images\\movies.png"
|
||||
res["ActionPara"] = "http://www.gewara.com" + i.select(".title a")[0]["href"]
|
||||
results.append(res)
|
||||
return json.dumps(results)
|
||||
|
||||
def openUrl(context,url):
|
||||
webbrowser.open(url)
|
||||
|
||||
if __name__ == "__main__":
|
||||
print query("movie geo")
|
||||
BIN
Plugins/Wox.Plugin.HotMovies/main.pyc
Normal file
BIN
Plugins/Wox.Plugin.HotMovies/main.pyc
Normal file
Binary file not shown.
11
Plugins/Wox.Plugin.HotMovies/plugin.json
Normal file
11
Plugins/Wox.Plugin.HotMovies/plugin.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ID":"D2D2C23B084D411DB66FE0C79D6C2A7D",
|
||||
"ActionKeyword":"hotmovie",
|
||||
"Name":"近期热映电影",
|
||||
"Description":"近期热映电影,powered by 格瓦拉",
|
||||
"Author":"qianlifeng",
|
||||
"Version":"1.0",
|
||||
"Language":"python",
|
||||
"Website":"http://www.getwox.com",
|
||||
"ExecuteFileName":"main.py"
|
||||
}
|
||||
Reference in New Issue
Block a user