#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2019/7/13 0:05
# @Author  : ganliang
# @File    : __init__.py.py
# @Desc    : 爬虫工具类
import json

# str='{"items":[{"avatarImage":"https://www.freebuf.com/buf/plugins/wp-user-avatar/images/wp-user-avatar-50x50.png","userid":"262535","postTitle":"Beef-XSS+Sunny-Ngrok实现内网穿透","excerpt":"交流方式丢下","timestamp":"","postUrl":"https://www.freebuf.com/articles/web/207259.html","reviewerName":"anghao","reviewerUrl":"","id":"269466","type":"","authorName":"anghao","level":"(2级)"},{"avatarImage":"https://www.freebuf.com/buf/plugins/wp-user-avatar/images/wp-user-avatar-50x50.png","userid":"286181","postTitle":"全球高级持续性威胁（APT）2019年中报告","excerpt":"美國找apt最厲害的操作是提供舉報渠道，舉報給獎金。。。","timestamp":"","postUrl":"https://www.freebuf.com/articles/system/207605.html","reviewerName":"wd1101001","reviewerUrl":"","id":"269464","type":"","authorName":"wd1101001","level":"(3级)"},{"avatarImage":"https://image.3001.net/images/headimg/pic14.png","fbnum":"1","postTitle":"Beef-XSS+Sunny-Ngrok实现内网穿透","excerpt":"在于渗透测试中真的是锦上添花！","timestamp":"","postUrl":"https://www.freebuf.com/articles/web/207259.html","reviewerName":"jesse","reviewerUrl":"","id":"269463","type":"","authorName":"jesse","level":"(3级)"},{"avatarImage":"https://image.3001.net/images/headimg/pic3.png","fbnum":"1","postTitle":"挖洞经验 | Panda反病毒软件本地提权漏洞分析（CVE-2019-12042）","excerpt":"十几年前的熊猫杀毒语音超好听 \':mrgreen:\' ","timestamp":"","postUrl":"https://www.freebuf.com/vuls/207765.html","reviewerName":"gdgfd","reviewerUrl":"","id":"269462","type":"","authorName":"gdgfd","level":"(3级)"},{"avatarImage":"https://image.3001.net/images/headimg/pic17.png","fbnum":"1","postTitle":"挖洞经验 | Panda反病毒软件本地提权漏洞分析（CVE-2019-12042）","excerpt":"熊猫杀毒。。。。。","timestamp":"","postUrl":"https://www.freebuf.com/vuls/207765.html","reviewerName":"Ksec","reviewerUrl":"","id":"269461","type":"","authorName":"Ksec","level":"(3级)"},{"avatarImage":"https://image.3001.net/images/headimg/pic2.png","fbnum":"1","postTitle":"Globelmposter勒索病毒最新变种预警：从“十二生肖”到“十二主神”","excerpt":"玉皇大帝不远了。。。","timestamp":"","postUrl":"https://www.freebuf.com/articles/system/207884.html","reviewerName":"Ksec","reviewerUrl":"","id":"269460","type":"","authorName":"Ksec","level":"(3级)"},{"avatarImage":"https://image.3001.net/images/headimg/pic6.png","fbnum":"1","postTitle":"全球高级持续性威胁（APT）2019年中报告","excerpt":"朝鲜有点猛啊","timestamp":"","postUrl":"https://www.freebuf.com/articles/system/207605.html","reviewerName":"Sudo","reviewerUrl":"","id":"269459","type":"","authorName":"Sudo","level":"(3级)"},{"avatarImage":"https://www.freebuf.com/buf/plugins/wp-user-avatar/images/wp-user-avatar-50x50.png","userid":"290731","postTitle":"Sniffglue：一款多线程数据包安全嗅探工具","excerpt":"菜鸟入住，来学习学习","timestamp":"","postUrl":"https://www.freebuf.com/sectool/207434.html","reviewerName":"ayuan931215","reviewerUrl":"","id":"269458","type":"","authorName":"ayuan931215","level":"(1级)"},{"avatarImage":"https://image.3001.net/images/headimg/pic8.png","fbnum":"1","postTitle":"全球高级持续性威胁（APT）2019年中报告","excerpt":"我大赵国61398部队誓要把这些狗屁APT组织打出屎来！！！","timestamp":"","postUrl":"https://www.freebuf.com/articles/system/207605.html","reviewerName":"中国黑客","reviewerUrl":"","id":"269457","type":"","authorName":"中国黑客","level":"(1级)"},{"avatarImage":"https://image.3001.net/images/index/wp-user-avatar-50x50.png","userid":"257893","postTitle":"Beef-XSS+Sunny-Ngrok实现内网穿透","excerpt":"不只是内网哦","timestamp":"","postUrl":"https://www.freebuf.com/articles/web/207259.html","reviewerName":"kaliking","reviewerUrl":"","id":"269456","type":"","authorName":"kaliking","level":"(3级)"}],"navi":{"more":"1","page":"0"}}'
#
# str='{items:[{"avatarImage":"https://www.freebuf.com/buf/plugins/wp-user-avatar/images/wp-user-avatar-50x50.png","userid":"262535","postTitle":"Beef-XSS+Sunny-Ngrok实现内网穿透","excerpt":"交流方式丢下","timestamp":"","postUrl":"https://www.freebuf.com/articles/web/207259.html","reviewerName":"anghao","reviewerUrl":"","id":"269466","type":"","authorName":"anghao","level":"(2级)"},{"avatarImage":"https://www.freebuf.com/buf/plugins/wp-user-avatar/images/wp-user-avatar-50x50.png","userid":"286181","postTitle":"全球高级持续性威胁（APT）2019年中报告","excerpt":"美國找apt最厲害的操作是提供舉報渠道，舉報給獎金。。。","timestamp":"","postUrl":"https://www.freebuf.com/articles/system/207605.html","reviewerName":"wd1101001","reviewerUrl":"","id":"269464","type":"","authorName":"wd1101001","level":"(3级)"},{"avatarImage":"https://image.3001.net/images/headimg/pic14.png","fbnum":"1","postTitle":"Beef-XSS+Sunny-Ngrok实现内网穿透","excerpt":"在于渗透测试中真的是锦上添花！","timestamp":"","postUrl":"https://www.freebuf.com/articles/web/207259.html","reviewerName":"jesse","reviewerUrl":"","id":"269463","type":"","authorName":"jesse","level":"(3级)"},{"avatarImage":"https://image.3001.net/images/headimg/pic3.png","fbnum":"1","postTitle":"挖洞经验 | Panda反病毒软件本地提权漏洞分析（CVE-2019-12042）","excerpt":"十几年前的熊猫杀毒语音超好听 \':mrgreen:\' ","timestamp":"","postUrl":"https://www.freebuf.com/vuls/207765.html","reviewerName":"gdgfd","reviewerUrl":"","id":"269462","type":"","authorName":"gdgfd","level":"(3级)"},{"avatarImage":"https://image.3001.net/images/headimg/pic17.png","fbnum":"1","postTitle":"挖洞经验 | Panda反病毒软件本地提权漏洞分析（CVE-2019-12042）","excerpt":"熊猫杀毒。。。。。","timestamp":"","postUrl":"https://www.freebuf.com/vuls/207765.html","reviewerName":"Ksec","reviewerUrl":"","id":"269461","type":"","authorName":"Ksec","level":"(3级)"},{"avatarImage":"https://image.3001.net/images/headimg/pic2.png","fbnum":"1","postTitle":"Globelmposter勒索病毒最新变种预警：从“十二生肖”到“十二主神”","excerpt":"玉皇大帝不远了。。。","timestamp":"","postUrl":"https://www.freebuf.com/articles/system/207884.html","reviewerName":"Ksec","reviewerUrl":"","id":"269460","type":"","authorName":"Ksec","level":"(3级)"},{"avatarImage":"https://image.3001.net/images/headimg/pic6.png","fbnum":"1","postTitle":"全球高级持续性威胁（APT）2019年中报告","excerpt":"朝鲜有点猛啊","timestamp":"","postUrl":"https://www.freebuf.com/articles/system/207605.html","reviewerName":"Sudo","reviewerUrl":"","id":"269459","type":"","authorName":"Sudo","level":"(3级)"},{"avatarImage":"https://www.freebuf.com/buf/plugins/wp-user-avatar/images/wp-user-avatar-50x50.png","userid":"290731","postTitle":"Sniffglue：一款多线程数据包安全嗅探工具","excerpt":"菜鸟入住，来学习学习","timestamp":"","postUrl":"https://www.freebuf.com/sectool/207434.html","reviewerName":"ayuan931215","reviewerUrl":"","id":"269458","type":"","authorName":"ayuan931215","level":"(1级)"},{"avatarImage":"https://image.3001.net/images/headimg/pic8.png","fbnum":"1","postTitle":"全球高级持续性威胁（APT）2019年中报告","excerpt":"我大赵国61398部队誓要把这些狗屁APT组织打出屎来！！！","timestamp":"","postUrl":"https://www.freebuf.com/articles/system/207605.html","reviewerName":"中国黑客","reviewerUrl":"","id":"269457","type":"","authorName":"中国黑客","level":"(1级)"},{"avatarImage":"https://image.3001.net/images/index/wp-user-avatar-50x50.png","userid":"257893","postTitle":"Beef-XSS+Sunny-Ngrok实现内网穿透","excerpt":"不只是内网哦","timestamp":"","postUrl":"https://www.freebuf.com/articles/web/207259.html","reviewerName":"kaliking","reviewerUrl":"","id":"269456","type":"","authorName":"kaliking","level":"(3级)"}],navi:{more:"1",page:"0"}}'
# body = str.replace(' ', '').replace('\n', '').replace('\r', '') \
#             .replace("'", '"').replace('{', '{"').replace(':', '\":') \
#             .replace('],', '],"').replace('",', '","').replace("\"\"", "\"") \
#             .replace("https\"", "https").replace(":\",", ":\"\",").replace(":{", "\":{") \
#             .replace(":[{", "\":[{")
# print body
# json.loads(body)
