示例#1
0
        "dept_id": "1",
        "search_dept_city": "北京",
        "dest_id": "34745",
        "search_dest_city": "半月",
        "dept_city": "上海",
        "highlight": "列表页传入",
        "first_image":
        "https://dimg04.c-ctrip.com/images/300p0m000000derkj7459.png",
        "url":
        "http://vacations.ctrip.com/grouptravel/p18557244s1.html?kwd=%e5%8d%8a%e6%9c%88%e6%b9%be",
        "supplier": "列表页传入",
        "brand": "列表页出传入"
    }
    #args={'source':'tuniu','search_dept_city_id': '1602', 'url': 'http://www.tuniu.com/product/300095519', 'brand': '罗马假期', 'dept_city': '南京', 'search_dest_city': '普吉岛', 'first_image': 'http://m.tuniucdn.com/fb2/t1/G5/M00/09/0D/Cii-tFomThiIDU_GAAEyLjwgIi4AAAb6QIwFvUAATJG78_w160_h90_c1_t0.jpeg', 'search_dept_city': '南京', 'search_dest_city_id': '', 'id': '300095519'}

    task = ttt(_worker='',
               _task_id='demo',
               _source='ctripGT',
               _type='GT_detail',
               _task_name='list_ctripGT_total_test',
               _used_times=0,
               max_retry_times=6,
               kwargs=args,
               _queue='grouptravel',
               _routine_key='grouptravel',
               list_task_token='test',
               task_type=0,
               collection='')
    s = GTDetailSDK(task=task)
    s.execute()
            raise ServiceStandardError(
                error_code=ServiceStandardError.EMPTY_TICKET)
        return result, error_code


if __name__ == '__main__':
    from proj.my_lib.Common.Task import Task as ttt
    args = {
        "city_id": "20645",
        "country_id": "133",
        "source": "ctripoi",
        "city_url": "asti7060",
        "date_index": 0
    }

    task = ttt(_worker='',
               _task_id='demo',
               _source='ctripPoi',
               _type='poi_list',
               _task_name='list_qyer_total_test',
               _used_times=0,
               max_retry_times=6,
               kwargs=args,
               _queue='poi_list',
               _routine_key='poi_list',
               list_task_token='test',
               task_type=0,
               collection='')
    s = PoiCtripListSDK(task=task)
    s.execute()
示例#3
0
                         i['suggest_type'], str(i['suggest']))
                    cursor.execute(sql)
                # cursor.executemany(SQL, save_result)
            except Exception as e:
                conn.rollback()
                traceback.print_exc(e)
            finally:
                conn.commit()
                conn.close()
            self.task.error_code = 0
        else:
            raise ServiceStandardError(error_code=ServiceStandardError.EMPTY_TICKET)

        return result, error_code

if __name__ == "__main__":
    from proj.my_lib.Common.Task import Task as ttt
    for keyword in 'abcdefghijklmnopqrstuvwxyz':
        args = {
            'keyword': keyword,
            'spider_tag':'hiltonSuggest',
            'source':'hilton',
            'extra': 'foreign'
        }
        task = ttt(_worker='', _task_id='demo', _source='', _type='suggest', _task_name='tes',
                    _used_times=0, max_retry_times=6,
                    kwargs=args, _queue='supplement_field',
                    _routine_key='supplement_field', list_task_token='test', task_type=0, collection='')
        ihg = HiltonSuggestCitySDK(task)

        ihg.execute()