# Path: crawler/gather/items.py
# class OnceItem(Item):
#     room_url = Field()
#     channel_name = Field()
#     host = Field()
#     followers = Field()
#     start_time = Field()
#     donate = Field()
#     description = Field()
#     announcement = Field()


from datetime import datetime
from ..items import OnceItem
import csv
# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html




class HardDiskPipeline(object):

    def open_spider(self, spider):
        self.utc_date = datetime.utcnow()
        self.once_csvfile = None
        self.once_csvwriter = None

    def close_spider(self, spider):
        if self.once_csvfile:
            self.once_csvfile.close()


# Path: crawler/gather/items.py
# class OnceItem(Item):
#     room_url = Field()
#     channel_name = Field()
#     host = Field()
#     followers = Field()
#     start_time = Field()
#     donate = Field()
#     description = Field()
#     announcement = Field()


# Path: crawler/gather/pipelines/harddisk.py
from datetime import datetime
from ..items import OnceItem
import csv

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

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html




class HardDiskPipeline(object):

    def open_spider(self, spider):
        self.utc_date = datetime.utcnow()
        self.once_csvfile = None
        self.once_csvwriter = None

    def close_spider(self, spider):
        if self.once_csvfile:
            self.once_csvfile.close()


    def process_item(self, item, spider):