Today, I had a chat on QQ's Happy Farm. I have a bunch of friends playing. Every time you steal other people's things, you must select one location to see if there is anything to pick. Then we need to extract the data from different locations. It seems a little too much trouble to steal the data. Sometimes my friends can pick up things, but I don't have time to check them (I can't check them every xx minutes. Check all my friends every time .. @, It will be exhausted ..)
Then I thought that if I had software, I could steal things from my friends. Check it every 10 minutes. If a friend can pick something from the ground, he will steal it back. This is so nice. It's too convenient to make money and upgrade .. ^_^. This type of software is called plug-ins.
The following is an analysis ..
Open QQ Happy Farm, will go to this address http://happyfarm.qzone.qq.com/api.php? MoD = user & act = run requests the data information of your farm, which is what your farm looks like. The request will post two data records:
Then, the information about your farm will be returned. The data is in JSON format and mine is as follows:
Then my farm is long like this:
Then, during the operations, such as buying seeds, planting, watering, and weeding, all requests are sent in post mode and JSON data is returned.
For example, if I buy a corn seed, he will send the following URL request: http://happyfarm.qzone.qq.com/api.php? MoD = repermission& act = buyseed
The data of post is as follows:
The returned result is as follows:
{"CID": 3, "code": 1, "direction": "", "cname": "\ u80e1 \ u841d \ u535c", "num": 1, "Money":-163}
The interface is like this:
Therefore, the plug-in software for automatic management of your farm is probably like this: first log on to QQ, then capture the status information of your farm, and then analyze the information, and then decide what operations to do, for example, when the ground is dry, the water is automatically watered, the crops are automatically picked, and the fruits in the warehouse are automatically sold ..
Next we will analyze the implementation of plug-ins that automatically go to a friend's farm to steal things at regular intervals.
If you click a friend on QQ Happy Farm, you can get the farm information of the friend. The request URL is generally:
Http://happyfarm.qzone.qq.com/api.php? MoD = user & act = run & flag = 1 & ownerid = 406951363
Then return:
Then, we can analyze the data to find out the state of a friend's farm, such as whether something is ripe or not.
For example, after program analysis data, found that a friend's farm has something to pick, I want to pick a friend's thing, will to http://happyfarm.qzone.qq.com/api.php? MoD = farmlandstatus & act = scrounge the request sent by this URL. The data of post is as follows:
Then, it will return to the State of a friend's farm.
Then we analyzed the data until there was nothing to pick up and analyzed the farm of the next friend.