联系官方销售客服
1835022288
028-61286886
微信小程序现在接入了页面收录并且容许推送小程序页面,收录非常不错,
这个是官方的推送文档
https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/search/search.submitPages.html
下面这个是别人用python写的推送,有没有高手能改成咱们的插件,可以直接在后台推送文章
import requests import math import time import json """ @author: axin @time:2019/12/14 14:30 @File: smpush.py """ # 设置配置信息 appid = "" # 小程序appid secret = "" # 小程序secret sn = 990 # 每次推送数量 timer = 5 # 每次睡眠时间 # 获取小程序assess_token tokenUrl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={}&secret={}".format(appid, secret) tokenReq = requests.get(tokenUrl) tokenResp = tokenReq.json() token = tokenResp['access_token'] # 拼接推送链接 url = "https://api.weixin.qq.com/wxa/search/wxaapi_submitpages?access_token={}".format(token) # 获取小程序招工推送列表 postData = { "access_token": token, "pages": [] } #读取所有待推送信息 with open('ids.txt', 'r') as f: ids = f.read() ids = ids.split(",") # 切割成数组保存 idsLen = len(ids) # 获取数组长度 maxGroup = math.ceil(idsLen / sn) # 最大的分组数量 group_m = -1 lists = [] # 使用新数组保存 for i in range(idsLen): if i % sn == 0: group_m += 1 lists.append([ids[i]]) else: lists[group_m].append(ids[i]) #分组推送 sign = 0 # 标记当前推送条数 for item in lists: arrData = [] # 声明或重置待提交数组 for i in item: data = { "path": "pages/detail/info/info", "query": "id=" + i } arrData.append(data) postData['pages'] = arrData onceReq = requests.post(url, json.dumps(postData)) onceRes = onceReq.json() signStart = sign * sn signEnd = (sign * sn) + sn if onceRes['errcode'] == 0: print("当前推送第{} - {} 条:成功!最后一条数据为:{}".format(signStart, signEnd, arrData[-1])) elif onceRes['errcode'] == 47006: print("当前推送第{} - {} 条:失败!返回状态码:{},最后一条数据为:{}, 当日推送已达到最大上限!".format(signStart, signEnd, onceRes['errcode'], arrData[-1])) break else: print("当前推送第{} - {} 条:失败!返回状态码:{},最后一条数据为:{}".format(signStart, signEnd, onceRes['errcode'], arrData[-1])) sign += 1 time.sleep(timer) # 设置睡眠时间