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)
正确的话会返回以下信息:
手把手教你用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
搭建方法
- 首先注册一个GitHub账号。
- 注册一个Notion账号,创建一个页面,选择右上角
Share
,选择Share to web
,选择Copy link
,找到此页面的PageID
,就是下图中Blog后面的一串字符。

- 打开此仓库 Fork一份,根据自己的情况修改
*site.config.js**
的相关内容。
module.exports = {
// 此处填写第二步中获取到的字符串
rootNotionPageId: '78fc5a4b88d74b0e824e29407e9f1ec1',
// if you want to restrict pages to a single notion workspace (optional)
// (this should be a Notion ID; see the docs for how to extract this)
rootNotionSpaceId: null,
// 站点基础设置
name: '名称',
domain: '域名',
author: '作者',
// 一些其他设置 (可选)
description: 'Example site description',
socialImageTitle: 'Transitive Bullshit',
socialImageSubtitle: 'Hello World! 👋',
// SNS设置 (可选)
twitter: 'transitive_bs',
github: 'transitive-bullshit',
linkedin: 'fisch2',
// default notion icon and cover images for site-wide consistency (optional)
// page-specific values will override these site-wide defaults
defaultPageIcon: null,
defaultPageCover: null,
defaultPageCoverPosition: 0.5,
// image CDN host to proxy all image requests through (optional)
// NOTE: this requires you to set up an external image proxy
imageCDNHost: null,
// Utteranc.es comments via GitHub issue comments (optional)
utterancesGitHubRepo: null,
// whether or not to enable support for LQIP preview images (optional)
// NOTE: this requires you to set up Google Firebase and add the environment
// variables specified in .env.example
isPreviewImageSupportEnabled: false,
// map of notion page IDs to URL paths (optional)
// any pages defined here will override their default URL paths
// example:
//
// pageUrlOverrides: {
// '/foo': '067dd719a912471ea9a3ac10710e7fdf',
// '/bar': '0be6efce9daf42688f65c76b89f8eb27'
// }
pageUrlOverrides: null
}
- 打开Vercel,使用Github账号登录,选择
New Project
,找到Frok过来的库,点击Import
。
notion API使用
status
Published
date
May 19, 2021
slug
notionapi
summary
使用python添加notion记录
category
技术分享
tags
Python
- 创建一个 Notion 机器人,输入名字,即可快速创建。
- 获取Token,点击 show,然后复制备用。

- 在需要使用API的页面中,点击 Share 并选择 Invite ,将机器人邀请进去,让其用于编辑的权限。


- 获取数据表的 database_id,点击数据表右上方的 ... 选择 Copylink ,连接如下方:https://www.notion.so/xinhuoip/9bcf00dce55c42799f3b177dc325aa18?v=217bbe82893e4e4aa228a19f3f2dc888 9bcf00dc-e55c-4279-9f3b-177dc325aa18 即为database_id 。
- 使用python的requests库get方法来读取notion页面数据,示例代码如下:
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 #查看是否安装成功
books如何快速有效搜索电子书
status
Published
date
Apr 18, 2021
slug
books
summary
搜集的一些书籍
category
技术分享
tags
书籍
阅读
一些获取电子书的渠道
未来世界的幸存者
搭建 Proxypool 抓取免费节点网站
status
Published
date
Apr 17, 2021
slug
proxypool
summary
节点网站搭建
category
技术分享
tags
节点
效果演示
演示地址:https://ditan.ml
项目地址
部署安装
- 下载最新版项目到服务器
打开 https://github.com/xiaofei-ya/proxypool/releases 选择合适的版本wget或宝塔远程下载到服务器。
下载或新建config.yaml
下载或新建source.yaml
- 解压文件并改名proxypool