Giter VIP home page Giter VIP logo

doubanrobot's Introduction

doubanrobot

A simple robot for douban.com

.
├── doubanrobot.py  --by requests.
├── douban_urllib.py	-- by urllib/urllib2
└── README.md

Notice: douban_urllib.py will never be updated.

Usage

import doubanrobot

email = '[email protected]'
password = 'password'

app = doubanrobot.DoubanRobot(email, password)

titile, content = app.get_joke()
print titile, content
if titile and content:
    print app.new_topic("cd", titile, content)

app.talk_status('hahahah, just for a test')
app.send_mail(63666378, 'Hallo, linsir.')
app.sofa("CentOS",['aaaa', 'bbbb', 'cccc'])

Topics_Up function

This function helps you to save time of manually posting a comment in order to up your topic. You can deploy this code on your server, such as Linux VPS

This function fetch all of your topics in your douban group homepage. The url of this page looks like this

	https://www.douban.com/group/people/your_douban_id/publish

The variable douban_id should be filled in. You can find it in the above url or your douban homepage.

Some people use characters as their douban_id, however I just test the interge type douban_id, which is also the original format.

topics_list is a list of the interger part of your topics url

	https://www.douban.com/group/topic/topic_id/

You can manually modify it, the example already given in the code comment.

In the end, content list contains all of your possible comments.

Tips

You can also combine this script with Linux crontab to automaticlly up your topics in specific time. For example:

	0 8-24/4 * * * /usr/bin/python /root/doubanrobot.py

If you didn't follow the group before, the service may return you a 403 response code, because you do not have right to make comment in this group without following it.

Example

up_topics_example

Todo List

  • Example Picture
  • Delete Previous Comments In One Topic
  • Usage Illustration
  • Delete All of Previous Comments In Account
  • Handle Multiple Pages Issues

doubanrobot's People

Contributors

linsir avatar starlightme avatar vi5i0n avatar

Watchers

James Cloos avatar DoveAlto avatar

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.