Fix mouse click issues and add a new hotmovie plugin.

This commit is contained in:
qianlifeng
2014-03-05 22:32:21 +08:00
parent 62475f9bcf
commit b38fa395ce
12 changed files with 222 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View 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")

Binary file not shown.

View 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"
}