VBA collects Sina Weibo data

Source: Internet
Author: User
Tags http request json

We'd better use the Sina Weibo open platform API to collect, of course, the API must have the app key

Take the following procedure:

1. We know that VBA acquisition data often use an object is the Microsoft.XMLHTTP object, this time also use the object, so we first use VBA to create an object, as shown in the code is to create a Microsoft.XMLHTTP object

2. Then, we casually find an interface, such as we will call the latest release of the microblogging, using the interface as shown in the figure, to see the details of the interface




3. As shown, this is what we see the use of this interface, we need to see three content: Url,http request method, as well as request parameters, let's look at how to use these several content




4. We first create a URL string to store the URL address mentioned above.


5.
And then create a variable Canshu to store parameters, we see that the interface has a total of three parameters, source is your appkey,count is you want to return a few tweets, and token is not a necessary parameter, so we can not, but I still fill in the following, You write your own words can not write, the following Canshu variable written as shown in the figure, is the parameter name and parameter value by the equal sign link, and then immediately followed by A & symbol, as shown in the figure:

6.
The URL and the parameters are then linked, and a & symbol is used, as shown in the diagram, between the URL and the Canshu. Interval
7 We then use the HTTP object we created to access it, as shown in the figure, using the Get method to obtain the


8. Returns the result is the JSON format data, this data needs us to parse, tomorrow next article I will introduce how to parse this heap garbled to be able to read the data

9. Here is the JSON data with a certain radical



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.