Ejemplo n.º 1
0
def follow():
    setup_poco()
    name = request.args.get('name')
    blur = int(request.args.get('blur'))
    print('To Follow: ' + name + ' blur: ' + str(blur))
    msg = wb.follow(name, blur=blur)
    return to_jsonstr(msg)
Ejemplo n.º 2
0
def get_homeTL():
    '''获取用户前n条微博信息'''
    setup_poco()
    number = int(request.args.get('num'))
    wb.back_home()
    wb.refresh_my_timeline()
    logstatus = wb.scroll_my_timeline(number=number, show=True)
    return to_jsonstr(logstatus)
Ejemplo n.º 3
0
def browse():
    '''获取用户前n条微博信息'''
    setup_poco()
    name = request.args.get('name')
    number = int(request.args.get('num'))
    logstatus = wb.browse_user_timeline(number=number,
                                        opt=0,
                                        username=name,
                                        Before=True)
    return to_jsonstr(logstatus)
Ejemplo n.º 4
0
def quickrepost():
    setup_poco()
    name = request.args.get('name')
    number = int(request.args.get('num'))
    logstatus = wb.browse_user_timeline(number=number,
                                        opt='快转',
                                        username=name,
                                        Before=False)
    content = logstatus[-1]['user'] + ':' + logstatus[-1]['status']
    state = 'repost: ' + content
    return to_jsonstr(state)
Ejemplo n.º 5
0
def send():
    setup_poco()
    wb.back_home()
    content = request.args.get('content')
    print('')
    content = content.replace("#", "%23")
    #content = parse.parse_qs(content
    #content = parse.unquote(content, encoding='utf-8', errors='replace').replace('#','%23')
    if not content:
        print('no content')
        state = 'Nothing Sent'
    else:
        wb.send_weibo(content)
        print(content)
        state = 'Sent: ' + content
    return to_jsonstr(state)
Ejemplo n.º 6
0
# -*- encoding=utf8 -*-
__author__ = "zxh"
import argparse
from airtest.core.api import *
from airtest.core.android import Android
from airtest.core.android.minitouch import *
import time
from poco.drivers.android.uiautomation import AndroidUiautomationPoco
from setting import writelog, setup_poco

poco, _ = setup_poco(state='usb')
WBInt = "com.weico.international:id/"
#back = [86,154] #resolution
top_sp = [0.5, 0.14]  #percent
UN = {}
UN['Toolbar'] = WBInt + "toolbar"
UN['SendOK'] = WBInt + "send_ok"
UN['TL_sp'] = WBInt + "item_timeline_sp"
UN['TL_user'] = WBInt + "item_timeline_user"
UN['TL_tool_'] = WBInt + "item_timeline_toolbar_"
UN['TL_tool_num'] = WBInt + "item_timeline_toolbar_num"
UN['TL_status'] = WBInt + "item_timeline_status"
UN['TL_time'] = WBInt + "item_timeline_time"
UN['scr2top'] = WBInt + "act_article_scroll2top"


@writelog()
def main_intWB():
    ''' 从手机主页进入app '''
    home()
    poco(text="微博国际版").click()
Ejemplo n.º 7
0
def weibo_intl():
    setup_poco()
    wb.main_intWB()
    logstatus = 'back to mainpage'
    return to_jsonstr(logstatus)
Ejemplo n.º 8
0
def unfollow():
    setup_poco()
    name = request.args.get('name')
    blur = int(request.args.get('blur'))
    msg = wb.unfollow(name, blur=blur)
    return to_jsonstr(msg)
Ejemplo n.º 9
0
def get_my_name():
    setup_poco()
    name = wb.get_current_user()
    return to_jsonstr(name)
Ejemplo n.º 10
0
def switch2user():
    setup_poco()
    name = request.args.get('name')
    msg = wb.switch2user(name)
    return to_jsonstr(msg)