A little record of using Sina Weibo PHP SDK

Source: Internet
Author: User

Introduction: This is a detailed page of using Sina Weibo's php sdk. It introduces PHP, related knowledge, skills, experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 346950 'rolling = 'no'>

Recently, I have been studying various APIs. I had to develop an API for everyone first, but the applications for everyone are too complicated. Net SKD is very useful,CodeIt is easy to write, but the PHP cannot be adjusted. The author has not updated it for several months. At the same time, there are several APIs that need to be tested, you said that at this stage of study and research, you are too lazy to apply, so you will suspend everyone's API. In the past two days, I have integrated an application in Sina cloud. By the way, I would like to know about Sina's APIs.

First, you must register the Sina developer account. (Today, it is strange that Sina's authentication cannot use Netease's 163 mailbox. It is estimated that the two companies are making another mistake. Oh, QQ can be used ).

Create a new application in three forms:

      1. Intra-site applications
        1. It is to create a site, which is an in-site application. In fact, it can be accessed from outside the site;
        2. You can set the intra-site access address from the application settings and the actual address, which is the same as non-dead, that is, the page nested in IFRAME in the app page;
        3. In the security settings, you can select whether to limit the domain name. If you do not limit the domain name, you can use this appkey and secret key to do a lot of websites. It is best not to restrict the learning test. If the operation is best to limit it.
      2. Client
        1. You can develop a client.
      3. Others
        1. Browser plug-ins or something.

We should naturally create in-site applications, and the settings are relatively simple. Sina's development documentation looks very simple, at least much simpler than it is:

Http://open.weibo.com/wiki/%E9%A6%96%E9%A1%B5

Its php sdk is here:

Http://code.google.com/p/libweibo/

I will introduce it directly. It looks good. I downloaded a copy and put it in the Apache htdocs directory, and then operated according to the description.

If there is a problem, it means:

Canvas_page is the "intra-site application address" set in "application page".

This statement, but config. php does not include this part. If you forget it, it is not necessary. However, an error occurred while running.

Error 1:Notice: Undefined index: script_uri inD: \ apache2.2 \ htdocs \ sinaapp \ index. phpOn Line13

This error is only a prompt, but it will affect the path returned after successful authentication. Many people have asked this question on the Internet. Some people say they want to enable the mod_rewrite module of Apache, but I have tried it. Enabling does not seem to solve the problem. Some people also say they need to enable the php_curl extension of PHP, I checked and enabled it. The source of the problem is that when the value $ _ server ['script _ URI '] is accessed, it cannot be accessed, and many people also say that script_uri is not built-in. I finally did not find it. I don't know if the author has enabled other uncommonly used extensions or modules, but we can do it ourselves: before access, define: $ _ server ['script _ URI '] = 'HTTP: // yoururl.

Error 2: Garbled

After the authentication is successful, the page is garbled. use NotePad to save all PHP files as utf8 and windows (it seems that the author uploaded PHP files written in Linux, but the problem is still very strange)

Error 3: browser compatibility

I still don't know what's going on yet. After I open it in chrome, it runs abnormally. I can use it normally in Firefox. This is really strange. The server code, do you still choose the browser of the client?

 

Now, let's write it here today. If you have any research on these issues, please let us know.

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/346950.html pageno: 4.

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.