ianalmore
This commit is contained in:
parent
1e22ca4995
commit
be3df6718f
2 changed files with 5 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
||||||
from util import hook, http, web
|
from util import hook, http, web, text
|
||||||
import time
|
import time
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ def plugin_details(slug):
|
||||||
def format_output(data):
|
def format_output(data):
|
||||||
""" takes plugin data and returns two strings representing information about that plugin """
|
""" takes plugin data and returns two strings representing information about that plugin """
|
||||||
name = data["plugin_name"]
|
name = data["plugin_name"]
|
||||||
description = data['description']
|
description = text.truncate_str(data['description'], 30)
|
||||||
url = data['website']
|
url = data['website']
|
||||||
authors = data['authors'][0]
|
authors = data['authors'][0]
|
||||||
authors = authors[0] + u"\u200b" + authors[1:]
|
authors = authors[0] + u"\u200b" + authors[1:]
|
||||||
|
|
|
@ -52,6 +52,8 @@ def format_item(item):
|
||||||
tag_text, url)
|
tag_text, url)
|
||||||
|
|
||||||
|
|
||||||
|
## HOOK FUNCTIONS
|
||||||
|
|
||||||
@hook.regex(*NEWEGG_RE)
|
@hook.regex(*NEWEGG_RE)
|
||||||
def newegg_url(match):
|
def newegg_url(match):
|
||||||
item_id = match.group(1)
|
item_id = match.group(1)
|
||||||
|
@ -65,17 +67,8 @@ def newegg(inp):
|
||||||
|
|
||||||
# form the search request
|
# form the search request
|
||||||
request = {
|
request = {
|
||||||
"PageNumber": 1,
|
|
||||||
"BrandId": -1,
|
|
||||||
"NValue": "",
|
|
||||||
"StoreDepaId": -1,
|
|
||||||
"NodeId": -1,
|
|
||||||
"Keyword": inp,
|
"Keyword": inp,
|
||||||
"IsSubCategorySearch": False,
|
"Sort": "FEATURED"
|
||||||
"SubCategoryId": -1,
|
|
||||||
"Sort": "FEATURED",
|
|
||||||
"CategoryId": -1,
|
|
||||||
"IsUPCCodeSearch": False
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# submit the search request
|
# submit the search request
|
||||||
|
|
Reference in a new issue