This commit is contained in:
qianlifeng 2014-03-22 16:42:49 +08:00
parent 9177f4b47d
commit dc274aed48
4 changed files with 0 additions and 52 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -1,34 +0,0 @@
#encoding=utf8
import requests
from bs4 import BeautifulSoup
import json
import webbrowser
def query(key):
k = key.split(" ")[1]
if not k:
return ""
r = requests.get('http://movie.douban.com/subject_search?search_text=' + k)
bs = BeautifulSoup(r.text)
results = []
for i in bs.select(".article table .pl2"):
res = {}
title = i.select("a")[0].text.replace("\n","").replace(" ","")
score = i.select("span.rating_nums")[0].text if i.select("span.rating_nums") else "0"
res["Title"] = title.split("/")[0]
year = i.select("p.pl")[0].text.split("-")[0] if i.select("p.pl")[0] else "Null"
alias = title.split("/")[1] if len(title.split("/")) >= 2 else "Null"
res["SubTitle"] = "Year: " + year + " Score: " + score + " Alias: " + alias
res["ActionName"] = "openUrl"
res["IcoPath"] = "Images\\movies.png"
res["ActionPara"] = i.select("a[href]")[0]["href"]
results.append(res)
return json.dumps(results)
def openUrl(context,url):
#shift + enter
#if context["SpecialKeyState"]["ShiftPressed"] == "True":
webbrowser.open(url)
if __name__ == "__main__":
print query("movie geo")

View File

@ -1,11 +0,0 @@
{
"ID":"D2D2C23B084D411DB66FE0C79D6C2A6D",
"ActionKeyword":"movie",
"Name":"Wox.Plugin.Douban.Movie",
"Description":"search douban movies",
"Author":"qianlifeng",
"Version":"1.0",
"Language":"python",
"Website":"http://www.getwox.com",
"ExecuteFileName":"main.py"
}

View File

@ -17,8 +17,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Fanyi", "Plugins
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Runtime", "Pythonnet.Runtime\Python.Runtime.csproj", "{097B4AC0-74E9-4C58-BCF8-C69746EC8271}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Runtime", "Pythonnet.Runtime\Python.Runtime.csproj", "{097B4AC0-74E9-4C58-BCF8-C69746EC8271}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Doc", "Plugins\Wox.Plugin.Doc\Wox.Plugin.Doc.csproj", "{6B6696B1-A547-4FD4-85EF-E1FD0F54AD2C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Infrastructure", "Wox.Infrastructure\Wox.Infrastructure.csproj", "{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Infrastructure", "Wox.Infrastructure\Wox.Infrastructure.csproj", "{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Everything", "Plugins\Wox.Plugin.Everything\Wox.Plugin.Everything.csproj", "{230AE83F-E92E-4E69-8355-426B305DA9C0}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Wox.Plugin.Everything", "Plugins\Wox.Plugin.Everything\Wox.Plugin.Everything.csproj", "{230AE83F-E92E-4E69-8355-426B305DA9C0}"
@ -61,10 +59,6 @@ Global
{097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|Any CPU.Build.0 = Debug|Any CPU {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|Any CPU.Build.0 = Debug|Any CPU
{097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Release|Any CPU.ActiveCfg = Release|Any CPU {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Release|Any CPU.ActiveCfg = Release|Any CPU
{097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Release|Any CPU.Build.0 = Release|Any CPU {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Release|Any CPU.Build.0 = Release|Any CPU
{6B6696B1-A547-4FD4-85EF-E1FD0F54AD2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6B6696B1-A547-4FD4-85EF-E1FD0F54AD2C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6B6696B1-A547-4FD4-85EF-E1FD0F54AD2C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6B6696B1-A547-4FD4-85EF-E1FD0F54AD2C}.Release|Any CPU.Build.0 = Release|Any CPU
{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Release|Any CPU.ActiveCfg = Release|Any CPU {4FD29318-A8AB-4D8F-AA47-60BC241B8DA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -95,7 +89,6 @@ Global
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution GlobalSection(NestedProjects) = preSolution
{353769D3-D11C-4D86-BD06-AC8C1D68642B} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {353769D3-D11C-4D86-BD06-AC8C1D68642B} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
{6B6696B1-A547-4FD4-85EF-E1FD0F54AD2C} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
{230AE83F-E92E-4E69-8355-426B305DA9C0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {230AE83F-E92E-4E69-8355-426B305DA9C0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
{8C14DC11-2737-4DCB-A121-5D7BDD57FEA2} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {8C14DC11-2737-4DCB-A121-5D7BDD57FEA2} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}
{049490F0-ECD2-4148-9B39-2135EC346EBE} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {049490F0-ECD2-4148-9B39-2135EC346EBE} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87}