I have always wanted to build a group buying navigation website, but I have never had time to do it. I have been idle for the past two days. I calmed down and looked at some group buying navigation websites. I wanted to develop them with my friends,
Later, I thought about whether the cycle may be a little long. Okay, let's not bother. This topic introduces the collection of group buying APIs in the group buying navigation module. I haven't found this on the internet for a long time.
Finally, there is no way to read the source code analysis by myself. I finally got it one step at a time and shared it with you here.
1. Open and find website management in the background of the Dawei group buying navigation-Add a website.
2. Enter the website name, Font, and region... We look for a website to write a rule, is the pull hand Network (http://www.lashou.com) it.
Enter the corresponding URL text box. The rebate address is also the benefit of inviting friends to the Group Buying website.
Usually invite friends to buy 10 yuan after the rebate, example: http://www.lashou.com /? Inviter = ienh6mtk4nta4mdc % 3d is followed by our unique number.
3. Now the key point is that all the cities in the handling API data are together, so I only need to fill in
Single City API is enough (http://open.client.lashou.com/v1/hao123)
Let's analyze the API rules. It's actually very simple. You can write the API rules by yourself.
In fact, the write API rules for APIS such as hao123 and Sohu are the same. First, open the XML interface for pulling the mobile phone hao123.
In comparison to API rules:
Urlset-url = subject: limengqikey-data-display-title, cityname: limengqikey-data-display-city, URL: limengqikey-Loc, nowprice: limengqikey-data-display-price, oldprice: limengqikey-data-display-value, lasttime: limengqikey-data-display-endtime, thumb: limengqikey-data-display-image, nowpeople: limengqikey-data-display-bought, starttime: limengqikey-data-display-starttime
It is not difficult to find that the rule is similar to the XML node. Urlset-url = is the XML (1, urlset, 2, URL) node that I found for group purchases. Generally, there are many.
The rule is simple: multiple fields are collected separated by commas.
Database field name: limengqikey-corresponding XML field level
Subject: limengqikey-data-display-title (title)
Cityname: limengqikey-data-display-city (city name)
URL: limengqikey-Loc)
Nowprice: limengqikey-data-display-price (current price)
Oldprice: limengqikey-data-display-value (original price)
Lasttime: limengqikey-data-display-endtime (Group Buying end time)
Thumb: limengqikey-data-display-image (group picture)
Nowpeople: limengqikey-data-display-bought (number of buyers)
Starttime: limengqikey-data-display-starttime (Start Time)
Now, we have finished writing the rules. You can collect the data, but during the collection process, we will find that some group purchases only provide the API group buying interface for a single city, and one city XML API
What should we do.
4. Multiple city collection rules (there are also two methods: 1. manually enter the city list, 2. Collect the city list)
Let's take a look at the example of Meituan Internet cafe,
(1) manually enter the city list
Enter the city list rule text box:
Customlist = cityid: 1-22-28-16809, cityname: Beijing-Shanghai-Xi'an-Lhasa
Customlist = cityid: separate city IDS (or pinyin)-numbers, and separate cityname: city names-numbers.
Multi-city API text box input:
Before modifying API for a single city in Meituan: http://www.meituan.com/api/v1/hefei/deals
After modification: http://www.meituan.com/api/v1/_limengqicityid/deals (_ limengqicityid Replace (city ID or pinyin), _ limengqicityname replace city name), this is multi-city API, single city do not fill in. OK.
2. Collect the city list
City list API: http://www.meituan.com/api/v1/divisions (unchanged)
City list rules: Response-divisions-division = cityid: limengqikey-ID, cityname: limengqikey-name
It is not difficult to find that this rule is the same as the product API rule. All are XML-level values.
Multi-city API text box input same as http://www.meituan.com/api/v1/_limengqicityid/deals (_ limengqicityid replacement (city ID or pinyin), _ limengqicityname replace city name
Now, the API rule analysis is complete. If you have any questions during the writing process, please join the Q group: 77245964, instance Website: www.880tg.com