Code Monkey home page Code Monkey logo

weibosubscriber's Introduction

WeiboSubscriber

WeiboSubscriber是一个针对特定微博用户,例如你关注的明星、你喜欢的小姐姐的订阅工具。该工具可以通过爬虫每天定时爬取某一用户的微博内容,将其更新动态发送至你的邮箱。

img


功能展示


WeiboSubscriber可以实现每天定时检索你的关注人的新动态,并把他/她的动态发到你的邮箱。支持多种微博内容(图片、文字、长微博、转发微博等,视频、音频附链接)。

img


Requirements

  • python 3.6
  • APScheduler 3.6.0
  • requests 2.21.0

使用方法


Step1 修改config.py中的参数实现订阅对象和邮箱的指定。

uid = '1288345514'   
user_name = u'李诞'   # 关注人姓名
containerid = '1076031288345514'
from_addr = '[email protected]'  # 发件邮箱
to_addr = '[email protected]'   # 收件邮箱
password = 'yourpassword'   # 你的邮箱密码
from_name = '李诞'   # 设定发件人姓名
to_name = 'plucky'  # 设定收件人姓名
subject = '李诞的微博' # 设定主题
send_hour = 22   # 设定每日发送时间
send_min = 30 

uidcontainerid需要通过检查网页元素获取。

  1. 浏览器登录m.weibo.com,搜索你想要关注的人,进去他/她的主页。
  2. 右键检查元素,在Network选项卡下,选取XHR,刷新页面。
  3. 可以在列表的最下方的条目获取到uidcontainerid

img


Step2 服务器部署

为长期保活,使用screen新建一个窗口,然后运行:

screen -S windowname
python main_frame.py

开发教程


日后会在博客里更新。PluckyMagnent


其它


  • 邮箱暂时仅支持QQ邮箱,输入的密码为授权码。QQ邮箱授权码仅有一个月有效期,如有时间会编写其它邮箱的调用模块,也可自行修改。
  • 如果想实现实时监控微博或修改check更新的频率,可以重写main_frame.py,利用Apscheduler中其它类别的scheduler实现不同的定时功能。

如有问题请发布在issue或联系邮箱[email protected].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.