This article has participated in the “Digitalstar Project” and won a creative gift package to challenge the creative incentive money.


preface

  • In November 2020

I started to create original technical content again, and so far I have published 60 original articles on Nuggets, with 47.7 million views and 1.5 million likes.

Technical content writers aren’t just publishing on a single platform anymore, they’re publishing articles, long videos, short videos all at once. After some explorations and attempts, I have decided to release original content mainly on the following platforms

  • The nuggets:Technical articles
  • B station:The teaching video
  • Wechat Official Account:Personal original content markup platform

I think I need a place where I can easily aggregate the content of various platforms, so that readers of one carrier can see the content of other carriers through this place, and in the future, I can also do some reader interaction in this place, such as lottery, discussion groups and so on.

In addition, I hope that the technologies used in this place are all completed by myself, and they are all the technical points I have written in articles or videos

  • August 31, 2021

I started planning, designing, and developing this little program through 30 iterations

This inside step on the pit countless, because the wechat audit is very strict, especially is the personal registration of small procedures, a lot of content is not you want to do can do. So for those of you who haven’t done small program development, you might not understand why some of the features are designed that way, right? Can’t we just do something? Because it just can’t.

Overview of function points

Implementation of key technical points

  • The aggregation

The aggregation itself is nothing more than extracting the API of the platform from which the data comes. But the trouble is that personal small program is not allowed to use webView, so in order to jump to the original web page, I had to use the mechanism of customer service message to deliver the URL.

  1. juejin.cn/post/700286…
  2. Highly praised article slide card component tutorial: juejin.cn/post/690614…
  • share

Originally this small procedure only for my own words is not so troublesome. Now to make it available to everyone, share it with your profile. After entering the mini program, check whether the configuration information is carried. If yes, use the configuration information carried.

  • Guide attention to the public number

In the mini program of wechat, only the

component can be used to guide the following public account, and only the public account can be associated with the same as the main body of the mini program. That how can we achieve guide attention to their own configuration of the public number information? The answer is to use the customer service message mechanism to achieve, but here is the two-dimensional code of the public number.

Through wechat ID or wechat original ID to generate two-dimensional code

https://open.weixin.qq.com/qr/code?username=ezfullstack
Copy the code

Read the two-dimensional code picture in uniCloud cloud function and upload it to wechat’s media material interface

let imageRes = await uniCloud.httpclient.request(url);

let buff = new Buffer(imageRes.data);

let form = new FormData();
form.append('media', buff, {
  filename: `The ${Date.now()}.jpg`.contentType: 'image/jpeg'
})

const access_token = await getAccessToken();

const res = await uniCloud.httpclient.request("https://api.weixin.qq.com/cgi-bin/media/upload?access_token="+access_token+"&type=image", {method:"POST".content: form.getBuffer(),
        headers: form.getHeaders(),
        dataType:"json"
})
Copy the code

The returned media_id can be used to send customer service messages to the users who want to follow

var res = await sendCustomerServiceMessage({
        touser:touser,
        msgtype:"image".image: {
                "media_id":media_id
        }
});
Copy the code
  • Caching mechanisms

UniCloud free cloud space performance is mediocre, coupled with the cloud function itself cold/hot startup big difference, must be well designed cache mechanism. I’ve designed three caching mechanisms in this little program.

1. cloudStorage

In the caching mechanism of HTTP requests in cloud functions, the cloud database is used for data caching to avoid re-requests every time the third-party interface data is requested, and the data within a period of time is obtained from the database cache.

2. localStorage

Front-end local data storage, small program exit is not destroyed.

3. memoryStorage

Small program life cycle within the data cache, to avoid a period of time for many requests cloud function, exit that is destroyed.

  • User isolation

If the fan groups of each technical content writer have overlapping parts, they can switch data sources in the small program. If there is no overlapping part, they cannot know other data sources, which fully guarantees the independence of their fan groups.

Why am I doing this? What do I get out of it?

It was originally my personal need, and even though no one else was using it, this tool could meet my own needs. And then it turned out that maybe other content creators like me needed tools like this, so it was open configuration, and everyone could use it.

Hopefully, this tool will make it easier for technical content creators to focus on creating content without trying to find ways to divert it.

If you are a technical content creator like me, please use wechat to search for “Ape Creation Aggregation Assistant” mini program

Why are the data sources only gold nuggets and B stations?

Because I only use nuggets and B… There will be no update in the future, I love the Nuggets, if the nuggets have video carrier, I will replace station B…

O (* ̄3 ̄)o