Rename the project.

This commit is contained in:
Yeechan Lu
2014-01-29 18:33:24 +08:00
parent c217828c18
commit 4db3bd7423
149 changed files with 1593 additions and 2021 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,34 @@
#encoding=utf8
from __future__ import unicode_literals
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://v2ex.com/?tab=all')
bs = BeautifulSoup(r.text)
results = []
for i in bs.select(".box div.item"):
res = {}
title = safeSelectText(i,".item_title")
subTitle = safeSelectText(i,".fade")
url = "http://v2ex.com" + i.select(".item_title a")[0]["href"]
res["Title"] = title
res["SubTitle"] = subTitle
res["ActionName"] = "openUrl"
res["IcoPath"] = "Images\\app.ico"
res["ActionPara"] = url
results.append(res)
return json.dumps(results)
def openUrl(url):
webbrowser.open(url)
if __name__ == "__main__":
print query("movie geo")

View File

@@ -0,0 +1,8 @@
[plugin]
ActionKeyword = v2ex
Name = Wox.V2ex
Author = qianlifeng
Version = 0.1
Language = python
Description = workflow for v2ex
ExecuteFile = main.py