Write "Baidu ad click robot" in java"

Source: Internet
Author: User
When you search for Chuanzhi podcasts and java training on Baidu, you will see some ad links. As long as you click these ad links, the fees of AD publishers will be consumed, the advertiser must pay the corresponding advertising fee for this click. Some people want to consume their competitor's advertising funds and fight against competition by clicking the ad link of their competitors on Baidu.

When you search for Chuanzhi podcasts and java training on Baidu, you will see some ad links. As long as you click these ad links, the fees of AD publishers will be consumed, the advertiser must pay the corresponding advertising fee for this click. Some people want to consume their competitor's advertising funds and fight against competition by clicking the ad link of their competitors on Baidu.

When you search for "Chuanzhi podcast" and "java training" on Baidu, you will see some ad links. As long as you click these ad links, the fees of the AD publishers will be consumed, the advertiser must pay the corresponding advertising fee for this click. Some people want to consume their competitor's advertising funds and fight against their competitors by clicking the ad link of their competitors on Baidu, can such clicks bring great economic losses to competitors? In fact, such click-by-click operations do not have a great impact on advertising publishers. This is like a merchant distributing leaflets on the street. There must be a lot of leaflets that are wasted, as long as the whole package of leaflets is not directly thrown into the recycle bin by the dispatch personnel, the final advertising effect of sellers can still achieve their expected goals.
Someone may think of repeatedly clicking on the competitor's advertisement to consume a lot of the competitor's advertising fees, so that the competitor's advertising plans will fail! This idea is obviously too simple, because not only do you have it, but many people have it. Baidu will certainly take it into consideration and take some technical measures to prevent it. Even if you use dynamic dialing to access the Internet and constantly change the IP address, a computer can click the same ad link no matter how many times in a day, baidu backend only charges 1 or 2 clicks.
People familiar with Web website development technologies should be clear that Baidu must be able to identify whether access from the same computer depends on cookies, we only need to clear the Cookie of the browser and add dynamic dialing to change the IP address to repeat Baidu's search and click the ad link on the search results page, baidu will regard these ad clicks as from multiple computers, and will charge for each click. If you use artificial methods to repeat these actions, as long as you persevere, it will certainly bring a great deal of advertising economic losses to your competitors. However, when you cause these losses to your competitors, you also need to spend a lot of energy and carefully calculate an account, and you will find that this is a completely "destroy the enemy three thousand, self-loss 10 thousand" method, the final winner is only Baidu.
Because the "Chuan Zhi podcast" has become "java training" and ". net training is a famous brand in the field. There are a lot of netizens who use Baidu to search for "Chuanzhi podcast" every day, some savvy training institutions have leveraged the power to sell their own ideas, and bought ads with the keyword "intelligence-based podcasts" on Baidu, now, you can search for "Chuanzhi podcast" on Baidu and still see advertisement links of some training institutions. This is like a competitor distributing a leaflet at home. If it is offline, it may have been a battle. However, it is not on the Internet, people wear shoes without shoes. The Unknown training institutions want to depend on the famous training institutions. How can you treat them? Is there really no countermeasure? After a meeting to discuss and study, the experts of Chuanzhi podcast decided to entrust me to study and make "Baidu ad click robot" or call "Baidu ad automatic click tool" for self-defense ". After eight days of hard work and a lot of tests, a perfect "Baidu ad click robot" was finally completed, and many of the time was spent on testing and waiting for the results, because Baidu's background does not charge immediately when a click occurs, but only counts the clicks that occurred one hour ago each time when a keyword is queried, in order to see whether Baidu's backend is billed for the clicks triggered by "Baidu ad click robot", we have dedicated some promotion keywords for research on Baidu, each time you modify the program and run it, you must wait for more than one hour to verify the result. Only after the Baidu background does deduct the advertising fee for these keywords, we can confirm that the "Baidu ad auto-click tool" program has succeeded, and we must perform a high-intensity test, only in this way can we determine whether our "Baidu ad click robot" has practical value and great power. The previous and later experiments cost us hundreds of dollars in advertising fees.
Through the development and testing of "Baidu ad click robot", we acknowledge that Baidu ads are still very good at preventing malicious clicks, even if we use our "Baidu ad click robot ", we cannot afford to consume a large amount of advertising fees from provocative competitors in a short period of time, because Baidu's billing statistics are not real-time. It is used to count the total number of clicks of a keyword in the previous hour, if the total number of clicks is large, far beyond the statistical amount of the past year-on-year period, Baidu background will deduct the excessive clicks according to a certain algorithm. We can only lower the click frequency of "Baidu ad click robot", but the click frequency is too low. This "Baidu ad auto click tool" has no practical value, if the click frequency is too high, Baidu will regard it as a malicious click and invalidate it. It has been a hard time for a long time! This is suitable for the number of clicks. Obviously, it takes a lot of time to experiment with your own advertising fee. Therefore, although our "Baidu ad auto-click tool" is completely tested in the program, due to Baidu's limit on the total number of clicks per unit time for a keyword, as a result, this "Baidu ad auto-click tool" cannot achieve our original intention. This is not because our "Baidu ad click robot" is incompetent, but because Baidu's background is too intelligent, it's really "Amazing!", even if you can call one thousand people to click an ad link on Baidu at the same time, it will be futile, because Baidu will invalidate it! In short, "Baidu ad click robot" was born, but we cannot use "Baidu ad auto click tool" to bring a fatal blow to the advertising promotion plans of malicious competitors, at most, it can be used in front of thieves, and each time it cannot be stolen too much, Baidu will find it and give up all the work.
After developing and testing the "Baidu ad click robot", our company has a full trust in Baidu's background and no longer worries that advertising on Baidu will lead to a large number of malicious clicks, instead, you can advertise on Baidu with confidence. Now, our "Baidu ad click robot" is basically shelved. However, our efforts and hard work cannot be wasted, it is very challenging and interesting to study and compile the "Baidu ad click robot" program. It involves a lot of technical details and skills, I want to explain all these technical details and skills to you. I don't know how many people are interested in this, or do I know whether this practice is illegal?
The following describes the implementation principles and technical details of the "Baidu ad click robot" program:
(1) Use the HttpClient open source toolkit to access a keyword search URL on Baidu, for example, http://www.baidu.com/s? Wd = % B4 % AB % D6 % C7 % B2 % A5 % BF % CD.
(2) Use HttpParser open-source toolkit to analyze the search result pages returned by Baidu for a keyword, and extract the ad links on the left and in the middle.
(3) use the HttpClient open-source toolkit to access the extracted ad link and save the result content of each link as an html file to confirm that the webpage with the ad link is obtained. Here, we need to share the Cookie information in step (1) and the url address in step 1 as a referer in order to be accessed by Baidu as the same browser.
(4) Repeat steps 1, 2, and 3, instead of directly accessing the address in step 2, because Baidu is changing the url of the AD link of a keyword each time, that is to say, the address of an ad link is one-time. After accessing the link, you must search for keywords again and obtain the new ad link address on the new result page.
(5) After writing the above program, the running effect seems to be perfect on the surface. However, Does Baidu actually charge for this simulated click access? We purchased some biased keyword advertisements for the itcast website on Baidu. We can be sure that almost no one clicks these biased keywords and then run our "Baidu ad click robot ", let it click on our ad link several times. Two hours later, let's see if Baidu's backend is billed. The result shows that although we get the ad link address from the search results page and access the ad page corresponding to the ad link address, Baidu does not charge for it, we thought Baidu too easy!
Http://www.baidu.com/baidu.php? Url = xxxxxxxxxx ", while the browser actually sends the Request Path to" http://www.baidu.com/baidu.php? Url = xxxxxxxxx & ck = 645.0.125.295.105.383.115.2563 ", with an additional ck parameter! How is this ck parameter appended?
(7) This must have triggered the javascript function when we click the ad link address in the browser. The javascript function modified the hyperlink address and appended it! When accessing the ad link address, our "Baidu ad auto-click tool" must also append the ck = 645.0.125.295.105.383.115.2563 parameter to simulate the effect of clicking a hyperlink. The value after the ck parameter is not fixed, but calculated by some algorithm. Do we have to use a java program to write such an algorithm tool and method? Let's take a look at how this javascript function is written! View the javascript source code on the baidu search result page. It is too difficult to read it. It seems that Baidu does not want us to understand it! It doesn't matter. Copy the code to the js file in myeclipse and format it with ctl + shift + f. The code is neatly arranged, this kind of tool software can also help you at critical moments!
(8) I have probably understood the functions and main code of all of the javascript Functions, but I am not sure about the detailed algorithms in the functions, be sure to clearly identify the things that must be understood and which ones are negligible. Are these javascript Functions transplanted into corresponding java code, or are these existing javascript Functions directly called using java code? The latter is obviously more convenient and easier. Can java code call javascript code? It seems that java 6 has provided such a new function. You can search and confirm it on the Internet. You can open the help document of java 6 and learn how to call javascript. Then, the javascript code on the baidu search result webpage is slightly modified to be suitable for calling java code. The main reason is that some variables are used in the original javascript to record mouse clicks and the mouse pops up, set the coordinates and time of the mouse clicks to simulate the variables.
(9) run the modified "Baidu ad click robot" again and let it click our ad link several times. Two hours later, check whether the Baidu background has been billed. The results showed that our program indeed modified the ad link address and accessed the ad page corresponding to the ad link address. However, Baidu still did not charge for it, so it is depressing! I want to give up. After all, I have been busy for several days. Is it so fruitless? Don't be reconciled. Please be brave and continue to study and experiment. Come and say "come on" to yourself. Just play!

(11) using "Baidu ad click robot" to complete several clicks only indicates that the program logic is passed, however, it cannot be confirmed whether it is of practical value or deterrent to competitors. The "Baidu ad click robot" program must have at least 50 clicks within an hour, in order to cause a heavy blow to the competitor's advertising promotion plan. In order to confirm whether the plan is feasible, we must first experiment with ourselves and open up hundreds of dollars in advertising fees so that the "Baidu ad click robot" program can be clicked at 50 per second, let's see how much we can spend on advertising when we were young. As a result, Baidu's background deducted more than a dozen clicks. It seems that even if every request sent by our "Baidu ad click robot" is efficient for Baidu, such requests are too regular or frequent, baidu background will invalidate them during billing statistics!
(12) How can I be reconciled if all the program logic is finished, but it cannot bring great practical value? Let's make some final efforts with luck! First, modify the fixed click frequency of the "Baidu ad click robot" program, and enable the "Baidu ad click robot" program to send a simulated search and click access only once after dialing again and changing the IP address, after suspending a random period of time, re-dial and change the IP address, and then send the next simulated search and click access. If one keyword has multiple promotion links, the ad link to be clicked last time is not the same link as the ad link to be clicked next time. Instead, multiple ad links are followed in sequence. After such a process repeats three to seven times, three to seven times are also calculated randomly, and a long random time is paused, in this way, there is no rule to follow for every simulated search and click of the "Baidu ad click robot" program. In addition, the program cannot access the ad link of a certain keyword all the time. Instead, it needs to perform Alternate access between AD links on several keyword search pages. For example, first, access the first link in all the ad links of the "Chuanzhi podcast" keyword, and then access the first link in all the ad links of the "java training" keyword, go back to the second link in all the ad links of the "Chuanzhi podcast" keyword, and then access the second link in all the ad links of the "java training" keyword, recurrence ......, the use of mutex multithreading technology can solve this problem well.
(13) various exceptions may occur during repeated running of the program, especially problems such as deadlocks in the program. It is very difficult to find out the bug. To facilitate Error Tracking and troubleshooting, use the Log4j open-source toolkit for logging.

The final statement:
This article and subsequent source code and video tutorials are only used for technical research and communication, and we hope that the majority of learners will not use them for commercial purposes, in particular, it cannot be used to combat competitors and consume competitor advertising funds. Otherwise, I will not be responsible for any legal disputes arising therefrom!
In addition, the ultimate goal of this article and subsequent video courses is to teach you network programming technology and analytical problem-solving skills, as long as Baidu adjusts the advertising algorithm, the program we teach will no longer work. However, as long as you study the techniques and steps described in this article, you will be able to write the corresponding "Baidu ad click robot" program. This is like learning to write a antivirus program for a virus. This program does not work for a new virus, but as long as you study the new virus, then, according to the original method of writing anti-virus programs, we will be able to write anti-virus programs for new viruses.

Http://blog.csdn.net/zhangxiaoxiang/archive/2010/03/30/5432280.aspx

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.