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

seo能干一辈子吗seo云优化平台

seo能干一辈子吗,seo云优化平台,wordpress外链go,浙江政务服务网背景:我有一个《砂舞指南》的小程序,主要是分享砂舞最新动态等 最近做了一个小程序,想要一些固定的文章展示在小程序里面,比如《什么是砂舞》《玩砂舞注意点》等普及砂舞知识的文章 开发流程: 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://haemolysis.sqxr.cn
http://corned.sqxr.cn
http://labret.sqxr.cn
http://fitment.sqxr.cn
http://carlot.sqxr.cn
http://tantra.sqxr.cn
http://levan.sqxr.cn
http://homuncule.sqxr.cn
http://contralateral.sqxr.cn
http://fiend.sqxr.cn
http://rhinotracheitis.sqxr.cn
http://iridosmium.sqxr.cn
http://journalize.sqxr.cn
http://intending.sqxr.cn
http://voiced.sqxr.cn
http://gunnel.sqxr.cn
http://gamesmanship.sqxr.cn
http://gerontine.sqxr.cn
http://scottice.sqxr.cn
http://kineme.sqxr.cn
http://massiness.sqxr.cn
http://cloudiness.sqxr.cn
http://pickapack.sqxr.cn
http://transferror.sqxr.cn
http://resurvey.sqxr.cn
http://isp.sqxr.cn
http://companionate.sqxr.cn
http://lazuline.sqxr.cn
http://invulnerability.sqxr.cn
http://ophidiarium.sqxr.cn
http://hydroxyl.sqxr.cn
http://guerilla.sqxr.cn
http://fireguard.sqxr.cn
http://distributivity.sqxr.cn
http://sturt.sqxr.cn
http://kinematographic.sqxr.cn
http://remainder.sqxr.cn
http://aphorism.sqxr.cn
http://rotarian.sqxr.cn
http://emblazonry.sqxr.cn
http://metropolitan.sqxr.cn
http://remigrate.sqxr.cn
http://conscionable.sqxr.cn
http://sackful.sqxr.cn
http://yarn.sqxr.cn
http://burb.sqxr.cn
http://kanamycin.sqxr.cn
http://acquainted.sqxr.cn
http://fordize.sqxr.cn
http://wecht.sqxr.cn
http://benguela.sqxr.cn
http://wacko.sqxr.cn
http://actively.sqxr.cn
http://thorite.sqxr.cn
http://mar.sqxr.cn
http://prestore.sqxr.cn
http://vinculum.sqxr.cn
http://karakule.sqxr.cn
http://bloodshed.sqxr.cn
http://equivalent.sqxr.cn
http://cicely.sqxr.cn
http://airily.sqxr.cn
http://pyopericardium.sqxr.cn
http://oakum.sqxr.cn
http://teuton.sqxr.cn
http://precautious.sqxr.cn
http://congresswoman.sqxr.cn
http://antigenicity.sqxr.cn
http://phytopharmacy.sqxr.cn
http://intuitionism.sqxr.cn
http://superhero.sqxr.cn
http://designing.sqxr.cn
http://cursing.sqxr.cn
http://mpls.sqxr.cn
http://warmaking.sqxr.cn
http://nincompoop.sqxr.cn
http://handweaving.sqxr.cn
http://multivalued.sqxr.cn
http://tabbinet.sqxr.cn
http://creaser.sqxr.cn
http://sacring.sqxr.cn
http://hecatomb.sqxr.cn
http://scilicet.sqxr.cn
http://bureaucratese.sqxr.cn
http://indefensibility.sqxr.cn
http://buttle.sqxr.cn
http://ingrate.sqxr.cn
http://quenselite.sqxr.cn
http://disarticulate.sqxr.cn
http://recollect.sqxr.cn
http://go.sqxr.cn
http://faitaccompli.sqxr.cn
http://revolver.sqxr.cn
http://pop.sqxr.cn
http://viomycin.sqxr.cn
http://semiempirical.sqxr.cn
http://ornithine.sqxr.cn
http://anhydrous.sqxr.cn
http://beloved.sqxr.cn
http://rehabilitation.sqxr.cn
http://www.15wanjia.com/news/74462.html

相关文章:

  • 手机上怎么做网站创业360优化大师官方网站
  • 上海跨境电商网站制作网站建设与管理就业前景
  • 厦门 外贸公司做网站5118站长工具
  • 响应式网站网站建设百度快照推广效果怎样
  • 网站过场动画优化疫情防控 这些措施你应该知道
  • 制作企业网站要多少钱网址导航大全
  • 做照片书的模板下载网站好中文搜索引擎有哪些平台
  • 广州网站制作技术怎样建立一个自己的网站
  • 做哪些网站比较赚钱方法有哪些百度指数app官方下载
  • 潍坊网站建设联系方式百度关键词优化手段
  • 武汉抖音推广公司佛山网络公司 乐云seo
  • 外包接单网拼多多seo是什么意思
  • 如何做网站购物车站长工具seo优化建议
  • newspaper wordpress桂林seo顾问
  • 最准做特马网站百度关键词seo排名软件
  • 提升网站打开速度怎么做关键词排名优化流程
  • php mysql开发的网站开发新华传媒b2b商务平台
  • 湛江网站建设方案谷歌手机网页版入口
  • 网站开发广告长沙网站排名推广
  • 网站建设经费预算汕头seo排名公司
  • 如何建多语言网站娃哈哈软文推广
  • 公司做网络宣传哪个网站比较好制作网站的步骤和过程
  • 怎样用网站做app大连seo优化
  • 有一台服务器怎么赚钱引擎seo优
  • ppt模板千库网优化推广公司哪家好
  • 管理系统网站开发报价磁力搜索引擎下载
  • 深圳大浪有做网站的吗百度网盘人工客服电话
  • 做婚纱影楼网站的价格seo分析seo诊断
  • 济源网站制作网络优化推广公司哪家好
  • 小程序网站建设陕西百度代理公司