Exemplo n.º 1
0
def detect(data):
    # return product price and name from amazon
    url_product = data.get("url_product")
    url_img = data.get("url_img")
    message_title = data.get("message_title")
    product_title_xpath = data.get("product_title_xpath")
    product_price_xpath = data.get("product_price_xpath")
    product_size_xpath = data.get("product_size_xpath")
    current_price = data.get("current_price")
    #detect price and title of product
    product_inform = __product(url_product, product_title_xpath,
                               product_price_xpath, product_size_xpath,
                               current_price)
    #send to beary chat
    bs.send(
        True,
        message_title,
        message_title,
        "shop-list",  #channel
        [{
            "title": product_inform.get("product"),
            "url": url_product,
            "text": product_inform.get("price"),
            "images": [{
                "url": url_img
            }]
        }])
Exemplo n.º 2
0
def detect(data):
    # return product price and name from amazon
    url_product = data.get("url_product")
    url_img_xpath = data.get("url_img")
    message_title = data.get("message_title")
    product_title_xpath = data.get("product_title_xpath")
    product_price_xpath = data.get("product_price_xpath")
    target_price = data.get("target_price")
    #detect price and title of product
    if_send, url_img, product_inform = __product(url_product, url_img_xpath,
                                                 product_title_xpath,
                                                 product_price_xpath,
                                                 target_price)
    #send to beary chat
    if if_send:
        bs.send(
            True,
            message_title,
            message_title,
            "promotion",  #channel
            [{
                "title": product_inform.get("product"),
                "url": url_product,
                "text": product_inform.get("price"),
                "images": [{
                    "url": url_img
                }]
            }])
Exemplo n.º 3
0
def detect():
    # receive the latest news
    try:
        news_info = __startup()
    except:
        news_info = {
            "startup_project": "NONE",
            "url_project": "NONE",
            "amount": "NONE",
            "timer": "",
            "url_img": "https://www.gate.io/images/startup/pendding.png"
        }
    bs.send(True, 
            "GATE STARTUP", 
            "GATE STARTUP", 
            "cc", #channel
            [{
                "title": news_info.get("startup_project"),
                "url": news_info.get("url_project"),
                "text": news_info.get("amount") + "\n" + news_info.get("timer"),
                "images": [
                    {"url": news_info.get("url_img")}
                ]
            }]
    )
Exemplo n.º 4
0
def detect():
    # receive the latest news
    news_info = __news()
    bs.send(True, 
            "GATE NEWS", 
            "GATE NEWS", 
            "cc", #channel
            [{
                "title": news_info.get("news"),
                "url": news_info.get("urls"),
                #"text": news_info.get("urls"),
                "images": [
                    {"url": "https://www.gate.io/images/gateio_en.svg"}
                ]
            }]
    )
Exemplo n.º 5
0
def detect(data):
    # return token price and name from amazon
    url_token = data.get("url_token")
    url_img = data.get("url_img")
    message_title = data.get("message_title")
    token_title_xpath = data.get("token_title_xpath")
    token_head_address_xpath = data.get("token_head_address_xpath")
    #detect price and title of token
    token_inform = __token(url_token, token_title_xpath,
                           token_head_address_xpath)
    #send to beary chat
    bs.send(
        True,
        message_title,
        message_title,
        "etherscan",  #channel
        [{
            "title": token_inform.get("token"),
            "url": url_token,
            "text": token_inform.get("percentage"),
            "images": [{
                "url": url_img
            }]
        }])