Esempio n. 1
0
def main(argv):
    reader = GomiReader()
    reader.municipality_id = "232114"
    reader.municipality_name = "愛知県豊田市"
    reader.datasource_url = "https://manage.delight-system.com/threeR/web/bunbetsu?menu=bunbetsu&jichitaiId=toyotashi&lang=ja"
    reader.target_url_base = "https://manage.delight-system.com/threeR/web/bunbetsu?menu=bunbetsu&jichitaiId=toyotashi&lang=ja"
    reader.target_pages = [ "" ]
    reader.datetime_selector = None
    reader.datetime_pattern = None
    reader.article_row_selector = "div.panel-heading"
    reader.article_column_selector = "a.panel-title, div.panel-body"
    reader.category_to_category_id = {
        PatternValuePair("燃やすごみ", "burnable"),
        PatternValuePair("埋めるごみ", "unburnable"),
        PatternValuePair("粗大ごみ", "oversized"),
        PatternValuePair("資源(ガラスびん・飲料缶・ペットボトル・有害ごみ・危険ごみ)", "recyclable"),
        PatternValuePair("プラスチック製容器包装", "plasticpackaging"),
        PatternValuePair("金属ごみ", "metal"),
        PatternValuePair("古布類", "pointcollection.cloth"),
        PatternValuePair("古紙類", "pointcollection.paper"),
        PatternValuePair("家電4品目(市では収集しないもの)", "legalrecycling"),
        PatternValuePair("禁止(市では収集しないもの)", "uncollectible")
    }
    # reader.note_to_category_id
    reader.category_definitions = {
        "burnable": { "name": "燃やすごみ" },
        "unburnable": { "name": "埋めるごみ" },
        "oversized": { "name": "粗大ごみ" },
        "plasticpackaging": { "name": "プラ容器包装" },
        "metal": { "name": "金属ごみ" },
        "recyclable": { "name": "資源" },
        "pointcollection.cloth": { "name": "古布類" },
        "pointcollection.paper": { "name": "古紙類" },
        "legalrecycling": { "name": "家電リサイクル法対象" },
        "uncollectible": { "name": "回収できません" }
    }
    print(reader.to_json())
Esempio n. 2
0
def main(argv):
    reader = GomiReader()
    reader.municipality_id = "232076"
    reader.municipality_name = "愛知県豊川市"
    reader.datasource_url = "https://www.city.toyokawa.lg.jp/smph/kurashi/gomirecycle/gomihayamihyo/"
    reader.target_url_base = "https://www.city.toyokawa.lg.jp/smph/kurashi/gomirecycle/gomihayamihyo/"
    reader.target_pages = [
        "agyo.html", "kagyo.html", "sagyo.html", "tagyo.html", "nagyo.html",
        "hagyo.html", "magyo.html", "yagyo.html", "ragyo.html", "wagyo.html"
    ]
    reader.datetime_selector = "p.update"
    reader.datetime_pattern = "更新日:%Y年%m月%d日"
    reader.article_row_selector = "caption ~ tr"
    reader.article_column_selector = "td"
    reader.category_to_category_id = [
        PatternValuePair("可燃ごみ", "burnable"),
        PatternValuePair("不燃ごみ", "unburnable"),
        PatternValuePair("資源", "recyclable"),
        PatternValuePair("危険ごみ", "hazardous"),
        PatternValuePair("粗大ごみ", "oversized"),
        PatternValuePair("家電リサイクル法対象品目", "legalrecycling"),
        PatternValuePair("市で処理できません。", "uncollectible")
    ]
    # reader.note_to_category_id
    reader.category_definitions = {
        "burnable": {
            "name": "可燃ごみ"
        },
        "unburnable": {
            "name": "不燃ごみ"
        },
        "recyclable": {
            "name": "資源"
        },
        "hazardous": {
            "name": "危険ごみ"
        },
        "oversized": {
            "name": "粗大ごみ"
        },
        "legalrecycling": {
            "name": "家電リサイクル法対象"
        },
        "uncollectible": {
            "name": "回収できません"
        }
    }
    print(reader.to_json())
Esempio n. 3
0
def main(args):
    reader = AichiNishioGomiReader()
    reader.municipality_id = "232131"
    reader.municipality_name = "愛知県西尾市"
    reader.datasource_url = None
    reader.target_url_base = "file:data/nishio/"
    reader.target_pages = [ "20191202-092059.pdf" ]
    # reader.datetime_selector = None
    # reader.datetime_pattern = None
    # reader.article_row_selector = None
    # reader.article_column_selector = None
    reader.category_to_category_id = {
        PatternValuePair("/.*/", "burnable")
    }
    # reader.note_to_category_id
    reader.category_definitions = {
        "burnable": { "name": "もやすごみ" },
    }
    print(reader.to_json())
Esempio n. 4
0
def main(argv):
    # メモ:
    # 市のホームページでは「ビールびん」の分類が「空きびん」と誤記されているので
    # 空きびん・生きびんについては分類ではなく備考により分別するようにした。
    reader = GomiReader()
    reader.municipality_id = "232025"
    reader.municipality_name = "愛知県岡崎市"
    reader.datasource_url = "https://www.city.okazaki.lg.jp/1100/1108/1151/p003039.html"
    reader.target_url_base = "https://www.city.okazaki.lg.jp/1100/1108/1151/"
    reader.target_pages = [
        "p003041.html", "p003042.html", "p003043.html", "p003044.html",
        "p003045.html", "p003046.html", "p003047.html", "p003048.html",
        "p003049.html", "p003050.html"
    ]
    reader.datetime_selector = "span.date"
    reader.datetime_pattern = "最終更新日%Y年%m月%d日"
    reader.article_row_selector = "tbody > tr"
    reader.article_column_selector = "td"
    reader.category_to_category_id = {
        PatternValuePair(r"/(?可燃ごみ)?/", "burnable"),
        PatternValuePair("不燃ごみ", "unburnable"),
        PatternValuePair("粗大ごみ", "oversized"),
        PatternValuePair("有害ごみ", "hazardous.harmful"),
        PatternValuePair("発火性危険ごみ", "hazardous.ignitable"),
        PatternValuePair("紙製容器包装", "paperpackaging"),
        PatternValuePair(r"/プラスチック製容器包?装/", "plasticpackaging"),
        PatternValuePair("ペットボトル", "petbottle"),
        PatternValuePair("空き缶", "can"),
        PatternValuePair("処理困難物", "uncollectible.difficult"),
        PatternValuePair("リサイクル料金が必要。製造メーカーの電話受付窓口へ",
                         "uncollectible.makercollection"),
        PatternValuePair(r"/家電4品目\sリサイクル料金が必要/", "legalrecycling")
    }
    reader.note_to_category_id = [
        PatternValuePair("資源回収または拠点回収へ", "localcollection"),
        PatternValuePair(r"/.*回収協力店へ.*/", "pointcollection"),
        PatternValuePair(r"/.*販売店へ.*/", "uncollectible.sellercollection"),
        PatternValuePair(r"/.*自主回収へ.*/", "uncollectible.sellercollection"),
        PatternValuePair(r"/.*青色のコンテナへ/", "can"),
        PatternValuePair(r"/.*茶色のコンテナへ/", "grassbottle"),
        PatternValuePair(r"/.*白色のコンテナへ/", "reusebottle")
    ]
    reader.category_definitions = {
        "burnable": {
            "name": "可燃ごみ"
        },
        "unburnable": {
            "name": "不燃ごみ"
        },
        "oversized": {
            "name": "粗大ごみ"
        },
        "hazardous": {
            "name": "危険/有害ごみ"
        },
        "hazardous.ignitable": {
            "name": "発火性危険ごみ"
        },
        "hazardous.harmful": {
            "name": "有害ごみ"
        },
        "paperpackaging": {
            "name": "紙製容器包装"
        },
        "plasticpackaging": {
            "name": "プラ容器包装"
        },
        "petbottle": {
            "name": "ペットボトル"
        },
        "reusebottle": {
            "name": "生きびん"
        },
        "grassbottle": {
            "name": "空きびん"
        },
        "can": {
            "name": "空き缶"
        },
        "localcollection": {
            "name": "資源回収/拠点回収"
        },
        "pointcollection": {
            "name": "回収ボックス"
        },
        "legalrecycling": {
            "name": "家電リサイクル法対象"
        },
        "uncollectible": {
            "name": "回収できません"
        },
        "uncollectible.difficult": {
            "name": "回収できません(処理困難)"
        },
        "uncollectible.sellercollection": {
            "name": "回収できません(販売店回収)"
        },
        "uncollectible.makercollection": {
            "name": "回収できません(メーカー回収)"
        }
    }
    print(reader.to_json())
Esempio n. 5
0
def main(argv):
    reader = GomiReader()
    reader.municipality_id = "232033"
    reader.municipality_name = "愛知県一宮市"
    reader.datasource_url = "https://www.city.ichinomiya.aichi.jp/kurashi/gomi/1000388/1000167/index.html"
    reader.target_url_base = "https://www.city.ichinomiya.aichi.jp/kurashi/gomi/1000388/1000167/"
    reader.target_pages = [
        "1001702.html", "1001703.html", "1001700.html", "1001701.html",
        "1001698.html", "1001699.html", "1001696.html", "1001697.html",
        "1001694.html", "1001695.html"
    ]
    reader.datetime_selector = "p.update"
    reader.datetime_pattern = "更新日\r\n%Y年%m月%d日"
    reader.article_row_selector = "tbody > tr"
    reader.article_column_selector = "td"
    reader.category_to_category_id = {
        PatternValuePair(r"/可燃ごみ.*/", "burnable"),
        PatternValuePair(r"/不燃ごみ.*/", "unburnable"),
        PatternValuePair(r"/粗大ごみ.*/", "oversized"),
        PatternValuePair(r"/空き缶・金属類.*/", "metal"),
        PatternValuePair(r"/プラスチック製容器包装.*/", "plasticpackaging"),
        PatternValuePair("ペットボトル", "petbottle"),
        PatternValuePair(r"/町内回収資源.*/", "localcollection"),
        PatternValuePair("戸別収集", "housecollection"),
        PatternValuePair(r"/市では収集.*できません.*/", "uncollectible")
    }
    reader.note_to_category_id = [
        PatternValuePair(r"/家電リサイクル法対象品目.*/", "legalrecycling")
    ]
    reader.category_definitions = {
        "burnable": {
            "name": "可燃ごみ"
        },
        "unburnable": {
            "name": "不燃ごみ"
        },
        "oversized": {
            "name": "粗大ごみ"
        },
        "metal": {
            "name": "金属ごみ"
        },
        "plasticpackaging": {
            "name": "プラ容器包装"
        },
        "petbottle": {
            "name": "ペットボトル"
        },
        "localcollection": {
            "name": "町内回収資源"
        },
        "housecollection": {
            "name": "戸別回収"
        },
        "legalrecycling": {
            "name": "家電リサイクル法対象品"
        },
        "uncollectible": {
            "name": "回収できません"
        }
    }
    print(reader.to_json())
Esempio n. 6
0
def main(argv):
    reader = GomiReader()
    reader.municipality_id = "232122"
    reader.municipality_name = "愛知県安城市"
    reader.datasource_url = "https://www.city.anjo.aichi.jp/kurasu/gomi/gomidashi/gomidasu/index.html"
    reader.target_url_base = "https://www.city.anjo.aichi.jp/kurasu/gomi/gomidashi/gomidasu/"
    reader.target_pages = [
        "a.html", "i.html", "u.html", "e.html", "o.html", "ka.html", "ki.html",
        "ku.html", "ke.html", "ko.html", "sa.html", "shi.html", "su.html",
        "se.html", "so.html", "ta.html", "chi.html", "tsu.html", "te.html",
        "to.html", "na.html", "ni.html", "nu.html", "ne.html", "no.html",
        "ha.html", "hi.html", "fu.html", "he.html", "ho.html", "ma.html",
        "mi.html", "mu.html", "me.html", "mo.html", "ya.html", "yu.html",
        "yo.html", "ra.html", "ri.html", "ru.html", "re.html", "ro.html",
        "wa.html"
    ]
    reader.datetime_selector = "p#tmp_update"
    reader.datetime_pattern = "更新日:%Y年%m月%d日"
    reader.article_row_selector = "p ~ table > tbody > tr"
    reader.article_column_selector = "td"
    reader.category_to_category_id = [
        PatternValuePair("燃やせるごみ", "burnable"),
        PatternValuePair("燃やせないごみ", "unburnable"),
        PatternValuePair("プラスチック製容器包装", "plasticpackaging"),
        PatternValuePair(r"/拠点.*品目/", "pointcollection"),
        PatternValuePair(r"/資源ごみ((びん|缶類|びん・缶類))/", "grassbottle"),
        PatternValuePair("資源ごみ(破砕困難ごみ・危険ごみ)", "hazardous"),
        PatternValuePair("資源ごみ(古着)", "cloth"),
        PatternValuePair("資源ごみ(古紙)", "paper"),
        PatternValuePair("粗大ごみ", "oversized"),
        PatternValuePair("持ち込みごみ", "oversized")
    ]
    reader.note_to_category_id = {
        PatternValuePair(r"/家電リサイクル法対象品目です.*/", "legalrecycling"),
        PatternValuePair(r"/.*/", "uncollectible")
    }
    reader.category_definitions = {
        "burnable": {
            "name": "燃やせるごみ"
        },
        "unburnable": {
            "name": "燃やせないごみ"
        },
        "plasticpackaging": {
            "name": "プラスチック製容器包装"
        },
        "pointcollection": {
            "name": "拠点回収品目"
        },
        "grassbottle": {
            "name": "びん・缶類"
        },
        "hazardous": {
            "name": "破砕困難ごみ・危険ごみ"
        },
        "cloth": {
            "name": "古着"
        },
        "paper": {
            "name": "古紙"
        },
        "oversized": {
            "name": "粗大ごみ・持ち込みごみ"
        },
        "legalrecycling": {
            "name": "家電リサイクル法対象品目"
        },
        "uncollectible": {
            "name": "回収できません"
        }
    }
    print(reader.to_json())
Esempio n. 7
0
def main(argv):
    reader = GomiReader()
    reader.municipality_id = "231002"
    reader.municipality_name = "愛知県名古屋市"
    reader.datasource_url = "http://www.city.nagoya.jp/kurashi/category/5-6-22-0-0-0-0-0-0-0.html"
    reader.target_url_base = "http://www.city.nagoya.jp/kankyo/page/"
    reader.target_pages = [
        "0000066278.html", "0000066280.html", "0000066282.html",
        "0000066283.html", "0000066302.html", "0000066303.html",
        "0000066305.html", "0000066307.html", "0000066308.html",
        "0000066309.html"
    ]
    reader.datetime_selector = "span.syosai_hiduke"
    reader.datetime_pattern = "最終更新日:%Y年%m月%d日"
    reader.article_row_selector = "tbody > tr"
    reader.article_column_selector = "td"
    reader.category_to_category_id = [
        PatternValuePair("可燃ごみ", "burnable"),
        PatternValuePair("不燃ごみ", "unburnable"),
        PatternValuePair("粗大ごみ", "oversized"),
        PatternValuePair("発火性危険物", "hazardous"),
        PatternValuePair("紙製容器包装", "paperpackaging"),
        PatternValuePair("プラ容器包装", "plasticpackaging"),
        PatternValuePair("ペットボトル", "petbottle"),
        PatternValuePair("空きびん", "grassbottle"),
        PatternValuePair("空き缶", "can"),
        PatternValuePair("紙パック", "beveragepack"),
        PatternValuePair("食用油", "pointcollection.edibleoil"),
        PatternValuePair("小型家電", "pointcollection.smallappliances")
    ]
    reader.note_to_category_id = [
        PatternValuePair(r"/.*処理して可燃ごみへ/", "burnable"),
        PatternValuePair(r"/.*家電リサイクル法対象.*/", "legalrecycling"),
        PatternValuePair(r"/.*集団資源回収.*/", "localcollection"),
        PatternValuePair(r"/.*小型家電回収ボックス.*/",
                         "pointcollection.smallappliances"),
        PatternValuePair(r"/.*(環境事業所|協力店|販売店|消火器|病院・診療所|ご相談ください).*/",
                         "uncollectible")
    ]
    reader.category_definitions = {
        "burnable": {
            "name": "可燃ごみ"
        },
        "unburnable": {
            "name": "不燃ごみ"
        },
        "oversized": {
            "name": "粗大ごみ"
        },
        "hazardous": {
            "name": "発火性危険物"
        },
        "paperpackaging": {
            "name": "紙製容器包装"
        },
        "plasticpackaging": {
            "name": "プラ容器包装"
        },
        "beveragepack": {
            "name": "紙パック"
        },
        "petbottle": {
            "name": "ペットボトル"
        },
        "grassbottle": {
            "name": "空きびん"
        },
        "can": {
            "name": "空き缶"
        },
        "legalrecycling": {
            "name": "集団資源回収"
        },
        "pointcollection": {
            "name": "回収ボックス"
        },
        "pointcollection.edibleoil": {
            "name": "回収ボックス(食用油)"
        },
        "pointcollection.smallappliances": {
            "name": "回収ボックス(小型家電)"
        },
        "localcollection": {
            "name": "集団資源回収"
        },
        "legalrecycling": {
            "name": "家電リサイクル法対象"
        },
        "uncollectible": {
            "name": "回収できません"
        }
    }
    print(reader.to_json())
Esempio n. 8
0
def main(argv):
    reader = AichiToyohashiGomiReader()
    reader.municipality_id = "232017"
    reader.municipality_name = "愛知県豊橋市"
    reader.datasource_url = "http://www2.city.toyohashi.aichi.jp/kankyo/dictionary/index.html"
    reader.target_url_base = "http://www2.city.toyohashi.aichi.jp/kankyo/dictionary/search.cgi?mode=index&key="
    reader.target_pages = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
    reader.datetime_selector = None
    reader.datetime_pattern = None
    reader.article_row_selector = "form > table > tr > td > table > tr > td > table > tr"
    reader.article_column_selector = "td"
    reader.category_to_category_id = {
        PatternValuePair("生ごみ", "foodscraps"),
        PatternValuePair("もやすごみ", "burnable"),
        PatternValuePair("こわすごみ", "crushable"),
        PatternValuePair("危険ごみ", "hazardous"),
        PatternValuePair("うめるごみ", "unburnable"),
        PatternValuePair("大きなごみ", "oversized"),
        PatternValuePair("びん・カン", "grassbottle"),
        PatternValuePair("ペットボトル", "petbottle"),
        PatternValuePair("プラマークごみ", "plasticpackaging"),
        PatternValuePair("布類", "cloth"),
        PatternValuePair("古紙", "localcollection.paper"),
        PatternValuePair("家電4品目", "legalrecycling"),
        PatternValuePair("―", "uncollectible"),
        PatternValuePair("パソコン", "uncollectible"),
        PatternValuePair("収集しません", "uncollectible")
    }
    # reader.note_to_category_id
    reader.category_definitions = {
        "burnable": {
            "name": "もやすごみ",
            "note": "週2回/指定ごみ袋"
        },
        "foodscraps": {
            "name": "生ごみ",
            "note": "週2回/指定ごみ袋"
        },
        "plasticpackaging": {
            "name": "プラマークごみ",
            "note": "水曜日/透明又は半透明の袋"
        },
        "crushable": {
            "name": "こわすごみ",
            "note": "月曜日又は火曜日(4週に1回)/指定ごみ袋"
        },
        "unburnable": {
            "name": "うめるごみ",
            "note": "月曜日又は火曜日(8週に1回)/透明又は半透明の袋"
        },
        "grassbottle": {
            "name": "びん・カン",
            "note": "木曜日又は金曜日/透明又は半透明の袋"
        },
        "petbottle": {
            "name": "ペットボトル",
            "note": "水曜日/透明又は半透明の袋"
        },
        "localcollection": {
            "name": "地域資源回収"
        },
        "localcollection.paper": {
            "name": "地域資源回収(古紙)"
        },
        "cloth": {
            "name": "布類",
            "note": "月曜日又は火曜日(8週に1回)/透明又は半透明の袋"
        },
        "hazardous": {
            "name": "危険ごみ",
            "note": "水曜日(4週に1回)/透明又は半透明の袋"
        },
        "oversized": {
            "name": "大きなごみ",
            "note": "戸別有料収集又は資源化センターへの自己搬入"
        },
        "legalrecycling": {
            "name": "家電4品目"
        },
        "uncollectible": {
            "name": "収集しません"
        }
    }
    print(reader.to_json())