# Path: lib/_db.py
# def get_collection(db_name, collection_name, client='mongo'):
#     client = client_db_map.get(client)
#     db = getattr(client, db_name, None)
#     return getattr(db, collection_name, None)


import _env
import json
import re
import time
    import sys
from lib._db import get_collection
from tornado.escape import xhtml_unescape
from judge_upload import exist_or_insert
from config.config import CONFIG
DB = CONFIG.MONGO.DATABASE


PAT = re.compile('[-#\w]+')


def find_first_tag(s):
    m = PAT.search(s)
    return m.group() if m else s


def remove_china_char(s):
    if not s:
        return s
    return re.sub(ur"[\u4e00-\u9fa5]+", '', s)


def cur_timestamp():
    return int(time.time() * 1000)


USERS = [
    {
        "id":           1,
        "name":         "man",
        "slug":         "man",
        "email":        "user@example.com",
        "image":        None,
        "cover":        None,
        "bio":          None,

# Path: lib/_db.py
# def get_collection(db_name, collection_name, client='mongo'):
#     client = client_db_map.get(client)
#     db = getattr(client, db_name, None)
#     return getattr(db, collection_name, None)


# Path: crawler/sharejs/sharejs_to_ghost.py
import _env
import json
import re
import time
    import sys
from lib._db import get_collection
from tornado.escape import xhtml_unescape
from judge_upload import exist_or_insert
from config.config import CONFIG

DB = CONFIG.MONGO.DATABASE


PAT = re.compile('[-#\w]+')


def find_first_tag(s):
    m = PAT.search(s)
    return m.group() if m else s


def remove_china_char(s):
    if not s:
        return s
    return re.sub(ur"[\u4e00-\u9fa5]+", '', s)


def cur_timestamp():
    return int(time.time() * 1000)


USERS = [
    {
        "id":           1,
        "name":         "man",
        "slug":         "man",
        "email":        "user@example.com",
        "image":        None,
        "cover":        None,
        "bio":          None,

        "website":      None,