# Path: crawler/gather/items.py
# class ChannelItem(Item):
#     office_id = Field()
#     short = Field()
#     name = Field()
#     image = Field()
#     url = Field()
# 
# class RoomItem(Item):
#     office_id = Field()
#     name = Field()
#     image = Field()
#     url = Field()
#     online = Field()
#     host = Field()
#     channel = Field()
#     followers = Field()
#     description = Field()
#     announcement = Field()
#     start_time = Field()


from scrapy import Spider, Request
from datetime import datetime
from ..items import ChannelItem, RoomItem
import json
# -*- coding: utf-8 -*-




class QuanminSpider(Spider):
    name = 'quanmin'
    allowed_domains = ['quanmin.tv']
    start_urls = [
        'https://www.quanmin.tv/json/categories/list.json'
    ]
    custom_settings = {
        'SITE': {
            'code': 'quanmin',
            'name': '全民',
            'description': '全民直播_做年轻人爱看的直播',
            'url': 'https://www.quanmin.tv',
            'image': 'https://static.quanmin.tv/static/v2/module/widget/header/img/logo_e00f8d6.svg',
            'show_seq': 7
        }
    }

    def parse(self, response):
        room_query_list = []
        for cjson in json.loads(response.text):
            yield ChannelItem({

# Path: crawler/gather/items.py
# class ChannelItem(Item):
#     office_id = Field()
#     short = Field()
#     name = Field()
#     image = Field()
#     url = Field()
# 
# class RoomItem(Item):
#     office_id = Field()
#     name = Field()
#     image = Field()
#     url = Field()
#     online = Field()
#     host = Field()
#     channel = Field()
#     followers = Field()
#     description = Field()
#     announcement = Field()
#     start_time = Field()


# Path: crawler/gather/spiders/quanmin.py
from scrapy import Spider, Request
from datetime import datetime
from ..items import ChannelItem, RoomItem
import json

# -*- coding: utf-8 -*-




class QuanminSpider(Spider):
    name = 'quanmin'
    allowed_domains = ['quanmin.tv']
    start_urls = [
        'https://www.quanmin.tv/json/categories/list.json'
    ]
    custom_settings = {
        'SITE': {
            'code': 'quanmin',
            'name': '全民',
            'description': '全民直播_做年轻人爱看的直播',
            'url': 'https://www.quanmin.tv',
            'image': 'https://static.quanmin.tv/static/v2/module/widget/header/img/logo_e00f8d6.svg',
            'show_seq': 7
        }
    }

    def parse(self, response):
        room_query_list = []
        for cjson in json.loads(response.text):
            yield ChannelItem({

                'office_id': str(cjson['id']),