我偶然发现了一个函数,它使用API从reddit获取顶部图像。sr='pics'url = r'http://www.reddit.com/r/{sr}/{top}.json'.format(sr=sr, top=sorting)#'sorting' is whether or not the sorting of the re
我希望将Python脚本作为API端点集成到后端,这样前端就可以按需调用Python脚本,特别是向Python脚本提供用户定义的输入(例如:哪个subreddit用于刮取)。Python脚本中的主要函数如下所示:#subname is name of subreddit to scrape fromitselfdef track_mentions_i