selfteaching / selfteaching/selfteaching-python-camp

Day12 为什么我用好友发送分享链接给自己的微信,但是最终好友的手机没有接收到分析结果

Open
#3,983 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
151
Forks
875
PR merge metrics
No merged PRs in 30d

Description

import os
import json
import wxpy
# 导入模块
from wxpy import *

import json
import requests
import pyquery
# 初始化机器人,扫码登陆
bot = Bot()
# 搜索名称含有 "豆彭" 的好友
my_friend = bot.friends().search('豆彭')[0]


#微信机器人启动了,现在要完成对好友豆彭的自动监听,一旦发送类型为sharing 的消息,获取这个消息的url并使用项目一中的代码进行分析并
#返回
@bot.register(chats = my_friend, msg_types = 'Sharing', except_self = True) #注册
def auto_reply(msg):     #定义一个自动回复的函数,在这一部分有一个大致的思路,但是到了具体细节写不出来是参考了同学的作业写出来的,但是我想知道到哪找
#答案也是一个很好的方法
    response = requests.get(msg.url)
    document = PyQuery(response.text)
    content = document('#js_content').text()
    from mymodule.stats_word import stats_text as a
    msg1 = a(content,100)
    return msg1
embed()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the WeChat sharing flow with the shown wxpy callback and inspect the handler around requests.get(msg.url). Check whether the callback receives the shared URL and whether stats_text from mymodule.stats_word returns a response; done means the sender receives the analysis result reliably.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.