This morning when I was looking through my notes, I found a code I wrote 3 months ago. I wrote it for fun at the time, so I'm sharing it with you now. I've put the code's github address at the end of the article, so you can get it if you need it. In fact, the code logic is quite simple. Of course, if beginners may not understand the code, I've also recorded a half-hour video to explain the code. Code written 3 months ago After reading this article, you can understand:
Okay, without further ado, let’s get straight to the point: Let me first tell you what this code can do——
1. Count the gender of your friends WeChat friends gender statistics The above are Erpang’s WeChat friends, a total of 306 people. Well, Erpang doesn’t have many friends. Among them, 60% are male. There is no way, boys from science and engineering schools are like this. The others are friends who did not fill in gender information. 2. Count the geographical distribution of friends The second function is to count the personal location information filled in by your WeChat friends in the message. The following figure shows the location distribution of Erpang’s friends: Bar Chart It can be seen that a large number of Erpang’s friends are in Beijing because Erpang studied in Beijing and now works in Beijing. Of course, the bar chart can vividly show the difference in the number of people in different regions, but the information displayed is not comprehensive and not so intuitive, so Erpang made a map visualization, as shown in the figure below. The warmer the color, the more friends there are in this place: Map Visualization 3. Make a word cloud of your friends’ nicknames When we chat with our WeChat friends, what we basically see are the nicknames we give them. It's rare that anyone cares about their nicknames. To be honest, after doing this statistics, I realized that our friends' nicknames are actually quite interesting. If you are interested, you can give it a try. Since this word cloud contains a lot of personal information, I will not put it here. 4. Count the high-frequency words in your friends’ signatures The principle of this function is to use natural language processing technology to extract keywords from each friend's personal signature, and then generate a word cloud according to the word frequency. The larger the keyword in the word cloud below, the more people use it. It seems that Erpang's friends say the most "self" and "we". Personal signature keyword frequency statistics 5. Combine all your friends’ profile pictures into one large picture This is actually to use a program to download the avatars of friends, and then use the PIL tool to synthesize a large picture, which looks more interesting. The following picture is an avatar picture made by Erpang using some of his friends' avatars: 6. WeChat automatically sends and replies messages For the automatic message receiving here, Erpang only made a simple demo, which you can take a look at first: The "robot" is the WeChat ID of the current program. A simple chat: Automatic reply message We can set keywords in the program, and then when a message is sent with the keyword, the corresponding sentence can be replied. Of course, this is just a simple demonstration, and you can send the corresponding message according to your needs. For example, you can use the program to send group greeting messages during festivals. What is the difference between this and using WeChat itself to send group messages? The difference is that the program can send personalized messages. For example: New Year is coming, and you want to send New Year greetings to everyone. If you directly send a message like "Every year has this day, every year has this morning, I wish you a happy new year." The recipient on the other end will definitely think that you are sending a mass message. What is the difference when using the program? When the program traverses your WeChat friends, it can obtain his nickname, notes and other information. When sending blessings, the program can add nicknames, names and other information, and can also randomly send blessings from the vocabulary. The above blessing can be changed to: "Hi, Tiezhu, may this day come every year, and may this day come every year. I wish you a happy new year." Of course, this is all later. In addition, this function is relatively more useful for some people who do sales-related work. Because different customers may ask many similar questions, you can write the answers to these high-frequency questions into the program to achieve automatic answers. There are such services on the Internet, but Erpang believes that they have problems. First, the service requires payment, and second, it is not safe to run WeChat on someone else's platform. 7. Extensions The so-called extension is to make personal WeChat into a service, and obtain corresponding information by requesting the APIs of other services in the program, such as obtaining some real-time messages. Let me give you a small example: I was playing a game called LetsDog some time ago. It was very simple. Users used certain virtual points to buy and sell virtual pets "LetsDogs" on a platform. So how could I know when a dog with a low price appeared? The answer is to write a program to monitor. Yes, as long as there is a seller selling dogs, as long as the price and grade meet the set strategy, the computer can screen out the dog and send out the transaction link. But Erpang can't just sit in front of the computer and wait, so Erpang chooses to let the program send the information directly to WeChat, so that Erpang can receive the transaction data in real time as long as he has a mobile phone. You can watch the short video below: On the left is Erpang's mobile phone, and on the right is a computer screen, which displays real-time trading data. As long as the trading data on the right meets my strategy, the trading link will be sent to me via WeChat. Of course, Erpang no longer plays this game. Friends who play stocks can also use this method to monitor stocks. Here’s a previous screenshot: On May 10, a dog that met the strategy was obtained. May 10,000 game push notifications In fact, the principle is very simple. It uses the WeChat web API to obtain WeChat friend information, send and receive information, and perform some analysis operations after obtaining WeChat friend information. WeChat Web Version The process is:
Since the text is not clear, just watch the video. If you have time, please open it on your computer and watch it now. I believe that the probability of you opening it again after you click on the collection is very low. You can reply to the background of the official account to get the high-definition video: WeChat friends You can get it. github code GitHub address: https://github.com/yangxuanxc/wechat_friends |
>>: 5G standard released, what is the difference with 4G? Or download 1G movie in 1 second
How people will choose is a very complicated ques...
Many people did not expect that the extended-rang...
NO.1 Corporate self-media is job self-media, not ...
Nowadays, Bilibili has become one of the most pop...
In the past half month, the rankings of many APP ...
The report reviews the development of information...
According to foreign media reports, Android fragm...
Produced by: Science Popularization China Author:...
Wearable devices are in the spotlight, but the at...
Practice meditation with Qian Wei (Qian Wei) Intr...
According to 36Kr citing Gaodu News, the Ministry...
May 30 Application and development stages of Chin...
I avoided the first day but couldn't avoid th...
For user operations personnel, if the product has...
Marketing is a war of perception . When we want t...