Open-source a library for simulating login to a social network website and open-source simulated login to a social network

Source: Internet
Author: User
Tags account security

Open-source a library for simulating login to a social network website and open-source simulated login to a social network

Website login is a required step to capture some websites. In most cases, we use a real browser to submit our login information, but nested browsers in the code will not only cause performance loss, it also brings the risk of crash. Therefore, the httpRequest library is used to simulate logon.Imitate-loginAt present, only the implementation of the Weibo web version and the Weibo Wap version is supported. The implementation of other plans will be determined based on the project's attention (Star & fork) Whether to update and the Update time.

If this item infringes on your rights and interests, please contact me in time (you can leave a message or email )! I will negotiate with you within one week of receipt.

This class library only provides one external method:

LoginResult Login(1: string userName, 2: string password, 3: LoginSite loginSite);

This method is located in the LoginHelper class of ImitateLogin, and needs to be instantiated before use. A class containing the logon Result Status, description information, and Cookies dictionary is returned by passing in the username, password, and website to which you log on.

This class library does not support verification codes. Weibo can set logon protection to avoid the appearance of verification codes:

Choose Settings> account Security> logon protection.


This project supports using Apache Thrift to call RPC in a multi-language environment. First, install Thrift and then use the following command to create an interface in the target language:

thrift --gen <language> ImitateLogin.thrift

In the preceding command<language>Replace it with the language you are using. Then add the server code on the csharp side:

public void Start() 
{ 
    TServerSocket serverTransport = new TServerSocket(7901, 0, false); 
    Login.Processor processor = new Login.Processor(new LoginHelper()); 
    TServer server = new TSimpleServer(processor, serverTransport); 
    Console.WriteLine("Starting server on port 7901 ..."); 
    server.Serve(); 
}

 

Then implement the client method in other languages (such as JAVA:

TTransport transport = new TSocket("localhost", 7901);
transport.open();
TProtocol protocol = new TBinaryProtocol(transport);
Login.Client client = new Login.Client(protocol);
client.Login("username", "password", LoginSite.Weibo);

 

Replace username and password in the preceding statement with the Weibo account used for logon.

You can run it in an environment that contains Mono or. Net Framework.Imitate-loginClass Library. The library contains a test form program created using Gtk +. If you want to use it, you need to install Gtk + for Mono.

This class library has been supported by social networking sites:

  • Weibo
  • WeiboWap

Support for planned completion:

  • Taobao
  • QQ
  • Facebook
  • Twitter
  • Google

The Plan Support Section is determined based on the project attention (Star & fork) Whether to update and the Update time.

If this item infringes on your rights and interests, please contact me in time (you can leave a message or email )! I will negotiate with you within one week of receipt.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.