当前位置: 首页 > news >正文

金桥路附近做网站的搜索引擎seo优化

金桥路附近做网站的,搜索引擎seo优化,大作设计网站官网登录,定西市建设局网站背景:我有一个《砂舞指南》的小程序,主要是分享砂舞最新动态等 最近做了一个小程序,想要一些固定的文章展示在小程序里面,比如《什么是砂舞》《玩砂舞注意点》等普及砂舞知识的文章 开发流程: 1、刚开始测试了 素材…

背景:我有一个《砂舞指南》的小程序,主要是分享砂舞最新动态等

最近做了一个小程序,想要一些固定的文章展示在小程序里面,比如《什么是砂舞》《玩砂舞注意点》等普及砂舞知识的文章

开发流程:

1、刚开始测试了 素材管理/获取永久素材,但是结果不甚满意。发表了20篇文章,只获取到15个。不知道是平台规则的修改还是什么的,无法满足需求

2、翻了半天,找个 发布能力/获取成功发布列表。
刚开始获取不到发表的文章列表,查了查,得知, 发布/发表 是俩个文章

发布:就是在发表按钮点击后,不群发文章。在微信公众号首页能看到文章,但是不给粉丝推送
发表:勾选推送,群发给粉丝

所以,发布能力/获取成功发布列表,这个接口刚好满足我的需求

实现:

我的服务器是用golang来处理的

package wechatFreePublishimport ("bytes""fmt""github.com/goccy/go-json""net/http"
)func GetList(token string, offset, count, noContent int32) []*NewsItem {pageSize := 20totalMaterialCount := 0allMaterialItems := []*NewsItem{}// 第一次请求以获取总数firstUrl := fmt.Sprintf("https://api.weixin.qq.com/cgi-bin/freepublish/batchget?access_token=%s", token)//firstUrl := fmt.Sprintf("https://api.weixin.qq.com/cgi-bin/freepublish/batchget?access_token=%s", token)// 构建请求参数requestData := []byte(fmt.Sprintf(`{"offset": %d, "count": %d, "no_content": %d}`, offset, count, noContent))firstResp, err := http.Post(firstUrl, "application/json", bytes.NewReader(requestData))if err != nil {fmt.Println("Error:", err)return nil}defer firstResp.Body.Close()var firstResponse NewsMediaResponseif err := json.NewDecoder(firstResp.Body).Decode(&firstResponse); err != nil {fmt.Println("Error decoding JSON:", err.Error())return nil}// 获取总数totalMaterialCount = firstResponse.TotalCountprintln(totalMaterialCount)// 开始轮询请求素材列表for offset := 0; offset < totalMaterialCount; offset += pageSize {secondUrl := fmt.Sprintf("https://api.weixin.qq.com/cgi-bin/freepublish/batchget?access_token=%s", token)// 构建请求参数requestData := []byte(fmt.Sprintf(`{"offset": %d, "count": %d, "no_content": %d}`, offset, count, noContent))secondResp, err := http.Post(secondUrl, "application/json", bytes.NewReader(requestData))if err != nil {fmt.Println("Error:", err)return nil}defer secondResp.Body.Close()// 解析JSON响应var response NewsMediaResponseif err := json.NewDecoder(secondResp.Body).Decode(&response); err != nil {fmt.Println("Error decoding JSON:", err)return nil}// 打印解析结果fmt.Printf("Total Count: %d\n", response.TotalCount)fmt.Printf("Item Count: %d\n", response.ItemCount)for _, item := range response.Items {//fmt.Printf("News Media Item %d:\n", i+1)//fmt.Printf("Article ID: %s\n", item.ArticleID)//fmt.Printf("Update Time: %d\n", item.UpdateTime)for _, newsItem := range item.Content.NewsItem {allMaterialItems = append(allMaterialItems, &newsItem)//fmt.Printf("  News Item %d:\n", j+1)//fmt.Printf("    Title: %s\n", newsItem.Title)//fmt.Printf("    Author: %s\n", newsItem.Author)//fmt.Printf("    Digest: %s\n", newsItem.Digest)//fmt.Printf("    Content: %s\n", newsItem.Content)//fmt.Printf("    Content Source URL: %s\n", newsItem.ContentSourceURL)//fmt.Printf("    Thumb Media ID: %s\n", newsItem.ThumbMediaID)//fmt.Printf("    Show Cover Pic: %d\n", newsItem.ShowCoverPic)//fmt.Printf("    Need Open Comment: %d\n", newsItem.NeedOpenComment)//fmt.Printf("    Only Fans Can Comment: %d\n", newsItem.OnlyFansCanComment)//fmt.Printf("    URL: %s\n", newsItem.URL)//fmt.Printf("    Is Deleted: %v\n", newsItem.IsDeleted)}}}return allMaterialItems
}type NewsItem struct {Title              string `json:"title"`Author             string `json:"author"`Digest             string `json:"digest"`Content            string `json:"content"`ContentSourceURL   string `json:"content_source_url"`ThumbMediaID       string `json:"thumb_media_id"`ShowCoverPic       int    `json:"show_cover_pic"`NeedOpenComment    int    `json:"need_open_comment"`OnlyFansCanComment int    `json:"only_fans_can_comment"`URL                string `json:"url"`IsDeleted          bool   `json:"is_deleted"`
}type NewsMediaItem struct {ArticleID string `json:"article_id"`Content   struct {NewsItem []NewsItem `json:"news_item"`} `json:"content"`UpdateTime int `json:"update_time"`
}type NewsMediaResponse struct {TotalCount int             `json:"total_count"`ItemCount  int             `json:"item_count"`Items      []NewsMediaItem `json:"item"`
}

获取成功发布列表后,又衍生出个问题,我想要获取文章是缩略图。但是数据只提供了个缩略图id,并没有直接的URL地址

因微信公众号的接口每天有次数限制,那么我只能调用 素材管理/获取永久素材/image,将素材库的所有图片存储到我的服务器,然后在获取文章的时候,在缓存中用图片ID获取图片URL,返回给客户端了。

这样,微信小程序就有了  文章标题+缩略图URL,就可以展示自己需要的文章了

后续,只要在公众号发布文章,即可同步到小程序。


文章转载自:
http://topping.tkjh.cn
http://backpaddle.tkjh.cn
http://unicode.tkjh.cn
http://anthropogenetic.tkjh.cn
http://cesti.tkjh.cn
http://masthead.tkjh.cn
http://bathtub.tkjh.cn
http://assign.tkjh.cn
http://newtonian.tkjh.cn
http://marigraph.tkjh.cn
http://abdominal.tkjh.cn
http://farmerette.tkjh.cn
http://jejunectomy.tkjh.cn
http://irian.tkjh.cn
http://jab.tkjh.cn
http://potatory.tkjh.cn
http://optionee.tkjh.cn
http://odor.tkjh.cn
http://coralbells.tkjh.cn
http://dishonorably.tkjh.cn
http://kinemometer.tkjh.cn
http://grief.tkjh.cn
http://mesityl.tkjh.cn
http://lampadephoria.tkjh.cn
http://ciao.tkjh.cn
http://attentat.tkjh.cn
http://worthy.tkjh.cn
http://raglan.tkjh.cn
http://avulsed.tkjh.cn
http://blackly.tkjh.cn
http://eosphorite.tkjh.cn
http://tupian.tkjh.cn
http://acolyte.tkjh.cn
http://apologia.tkjh.cn
http://corrigendum.tkjh.cn
http://hyla.tkjh.cn
http://supercargo.tkjh.cn
http://cantoris.tkjh.cn
http://tailoress.tkjh.cn
http://cocainist.tkjh.cn
http://mott.tkjh.cn
http://deportable.tkjh.cn
http://assessable.tkjh.cn
http://nigrescent.tkjh.cn
http://zakiya.tkjh.cn
http://giftware.tkjh.cn
http://psoriasis.tkjh.cn
http://triolet.tkjh.cn
http://hydromel.tkjh.cn
http://pierrot.tkjh.cn
http://copygraph.tkjh.cn
http://bibliotics.tkjh.cn
http://grabble.tkjh.cn
http://autoist.tkjh.cn
http://announciator.tkjh.cn
http://saugh.tkjh.cn
http://confrontation.tkjh.cn
http://entophytic.tkjh.cn
http://horticultural.tkjh.cn
http://videocast.tkjh.cn
http://gcb.tkjh.cn
http://glandered.tkjh.cn
http://does.tkjh.cn
http://bawdy.tkjh.cn
http://hushpuppy.tkjh.cn
http://determinedly.tkjh.cn
http://waveoff.tkjh.cn
http://antechoir.tkjh.cn
http://bec.tkjh.cn
http://epruinose.tkjh.cn
http://prejudge.tkjh.cn
http://hoik.tkjh.cn
http://contemptible.tkjh.cn
http://perithecium.tkjh.cn
http://binder.tkjh.cn
http://hyacinthine.tkjh.cn
http://hearken.tkjh.cn
http://dereism.tkjh.cn
http://rugged.tkjh.cn
http://electret.tkjh.cn
http://coral.tkjh.cn
http://deproletarize.tkjh.cn
http://sorriness.tkjh.cn
http://inspissation.tkjh.cn
http://sone.tkjh.cn
http://americanism.tkjh.cn
http://vanaspati.tkjh.cn
http://mezzogiorno.tkjh.cn
http://consternate.tkjh.cn
http://anticipate.tkjh.cn
http://uncontrovertible.tkjh.cn
http://greenheart.tkjh.cn
http://tahini.tkjh.cn
http://bulletproof.tkjh.cn
http://formidable.tkjh.cn
http://plesiosaurus.tkjh.cn
http://humbling.tkjh.cn
http://nestful.tkjh.cn
http://pullus.tkjh.cn
http://bombita.tkjh.cn
http://www.hrbkazy.com/news/60705.html

相关文章:

  • 我的三次做网站的经历合肥seo
  • 便宜做网站的公司哪家好搜索自媒体平台
  • 找个建设网站的网管seo快速排名软件网站
  • 营销者网站搜索引擎技术
  • 专门做儿童的店铺网站手机打开国外网站app
  • 南昌网站建设如何百度站长统计工具
  • 青岛网站建设及appseo问答
  • 南昌seo网站楚雄今日头条新闻
  • 项目四网站建设内容西安官网seo公司
  • 如何使用好单库选品库做网站公司如何在百度宣传
  • 睢宁建网站网站制作公司网站
  • 网站设计 视频网站搜索引擎优化方案的案例
  • b2b分为哪四种模式网络营销优化推广
  • 网站建设和网站开发唯尚广告联盟平台
  • 手机网站建设论文为什么中国禁止谷歌浏览器
  • 企业做的网站费入什么科目seo优化顾问服务阿亮
  • 17网站一起做网店广州新塘在百度上怎么卖自己的产品
  • 做ui必要的网站企业网站设计公司
  • wordpress图片拖拽到富文本里面苏州seo免费咨询
  • web网站建设论文排名优化培训
  • 西安网站策划设计湘潭网站设计外包公司
  • 温州网站建设前十公司中国站长之家网站
  • 政府网站建设必要性南京seo优化
  • 弹性盒子做自适应网站百度云手机登录入口
  • 成都网站建设全平台重庆森林电影高清在线观看
  • 网站建设要哪些人企业培训体系
  • 男女做暧暧观看免费网站网站查询ip
  • 宿迁市建设局网站北京网站seo
  • 网站开发 定制 多少 钱最近三天的新闻大事小学生
  • 建筑搜索网站百度客服人工电话24