python三要素实名认证接口
status
Published
date
Jun 19, 2021
slug
python01
summary
Python实名认证
category
技术分享
tags
Python
实名认证

说明

利用flask搭建了一个会员中心,需要添加一个实名认证的模块,现在的实名认证一般是银行卡+身份证+姓名或电话号码+身份证+姓名或者支付宝扫脸认证。
选用相对不那么要求隐私的,手机号+身份证+姓名三要素认证。

使用

在阿里云API市场选了一个三要素认证的服务,购买了试用套餐,10条请求的进行测试。
python的给了一个接口的代码,如下:
import urllib, urllib2, sys


host = 'http://sjsys.market.alicloudapi.com'
path = '/communication/personal/1979'
method = 'POST'
appcode = '你自己的AppCode'
querys = ''
bodys = {}
url = host + path

bodys['idcard'] = '''320623198810077180'''
bodys['mobile'] = '''13636643333'''
bodys['name'] = '''张三'''
post_data = urllib.urlencode(bodys)
request = urllib2.Request(url, post_data)
request.add_header('Authorization', 'APPCODE ' + appcode)
//根据API的要求,定义相对应的Content-Type
request.add_header('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8')
response = urllib2.urlopen(request)
content = response.read()
if (content):
    print(content)
然而,这代码太古旧基本用不了了,还好有requests这个神器。
简单修改一下代码如下:
import requests
data = {
    'idcard': '身份证号码',
    'mobile': '手机号码',
    'name': '姓名',
}
url = 'http://sjsys.market.alicloudapi.com/communication/personal/1979'
headers = {
    'Authorization': 'APPCODE ' + 你的appcode,
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
}
r = requests.post(url=url,data=data,headers=headers)
content = r.text
if (content):
    print(content)
正确的话会返回以下信息:
Article Details
手把手教你用Notion搭建博客
status
Published
date
Jun 9, 2021
slug
NotionBlog
summary
notion搭建博客的方法很多,今天介绍一个Notion+Vercel+Next.js搭建博客的方法。
category
技术分享
tags
notion

说明

notion搭建博客的方法很多,今天介绍一个Notion+Vercel+Next.js搭建博客的方法,作者的Github

演示

演示地址: Sky's Blog

搭建方法

  1. 首先注册一个GitHub账号。
  1. 注册一个Notion账号,创建一个页面,选择右上角Share,选择Share to web,选择Copy link,找到此页面的PageID,就是下图中Blog后面的一串字符。
    1. 打开此仓库 Fork一份,根据自己的情况修改*site.config.js**的相关内容。
      1. 打开Vercel,使用Github账号登录,选择New Project,找到Frok过来的库,点击Import
        1. 选择 Select ->修改PROJECT NAME(可选)->点击Deploy
        1. 等待部署完成即可。
        Article Details
        notion API使用
        status
        Published
        date
        May 19, 2021
        slug
        notionapi
        summary
        使用python添加notion记录
        category
        技术分享
        tags
        Python
        1. 创建一个 Notion 机器人,输入名字,即可快速创建。
        1. 获取Token,点击 show,然后复制备用。
          1. 在需要使用API的页面中,点击 Share 并选择 Invite ,将机器人邀请进去,让其用于编辑的权限。
            1. 获取数据表的 database_id,点击数据表右上方的 ... 选择 Copylink ,连接如下方:https://www.notion.so/xinhuoip/9bcf00dce55c42799f3b177dc325aa18?v=217bbe82893e4e4aa228a19f3f2dc888 9bcf00dc-e55c-4279-9f3b-177dc325aa18 即为database_id
            1. 使用python的requests库get方法来读取notion页面数据,示例代码如下:
              1. 通过python的requests库中的post方法来操作notion添加数据,示例代码如下:
                1. 结合以前的线报类代码,可直接将采集的数据直接写入到notion。
                  Article Details
                  Linux安装golang
                  status
                  Published
                  date
                  Apr 20, 2021
                  slug
                  golang
                  summary
                  安装golang
                  category
                  学习思考
                  tags
                  Go
                  wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz #下载go
                  rm -rf /usr/local/go && tar -C /usr/local -xzf go1.16.3.linux-amd64.tar.gz #解压到/usr/local/go
                  export PATH=$PATH:/usr/local/go/bin #添加到PATH环境变量
                  go version #查看是否安装成功
                   
                  Article Details
                  books如何快速有效搜索电子书
                  status
                  Published
                  date
                  Apr 18, 2021
                  slug
                  books
                  summary
                  搜集的一些书籍
                  category
                  技术分享
                  tags
                  书籍
                  阅读
                  一些获取电子书的渠道
                   
                  未来世界的幸存者
                  Article Details
                  搭建 Proxypool 抓取免费节点网站
                  status
                  Published
                  date
                  Apr 17, 2021
                  slug
                  proxypool
                  summary
                  节点网站搭建
                  category
                  技术分享
                  tags
                  节点

                  效果演示

                  演示地址:https://ditan.ml

                  项目地址

                  部署安装

                  • 解压文件并改名proxypool

                  运行

                  启动程序
                  更新配置
                  Article Details