Table of Contents
Use the OAuth authentication of Sina Weibo API to publish Weibo instances, apioauth
Home Backend Development PHP Tutorial Use the OAuth authentication of Sina Weibo API to publish Weibo instances, apioauth_PHP tutorial

Use the OAuth authentication of Sina Weibo API to publish Weibo instances, apioauth_PHP tutorial

Jul 13, 2016 am 10:00 AM
oauth authentication Sina Weibo

Use the OAuth authentication of Sina Weibo API to publish Weibo instances, apioauth

Continuing the previous article "Detailed explanation of the main process of Sina Weibo OAuth authentication and storage", now we will Use it to tweet.

We have saved the oauth_token and oauth_secret of user Sina Weibo to

$_SESSION['oauth_token']=$result['oauth_token'];
$_SESSION['oauth_secret']=$result['oauth_secret'];

Inside, what you have to do now is very simple...just call the sinaOauth class to publish. .

The code is as follows:

//Statuses/update
$c = new WeiboClient( WB_AKEY , 
           WB_SKEY , 
           $_SESSION['last_key']['oauth_token'] , 
           $_SESSION['last_key']['oauth_token_secret'] );

$msg = $c->update("测试发表微博");
if ($msg === false || $msg === null){
  echo "Error occured";
  return false;
}
if (isset($msg['error_code']) && isset($msg['error'])){
  echo ('Error_code: '.$msg['error_code'].'; Error: '.$msg['error'] );
  return false;
} 
echo($msg['id']." : ".iconv('UTF-8', 'GB2312',
$msg['text'])." - ".$msg["created_at"]);

Copy after login

This is the simplest one...

The above is the entire content of this article, I hope you all like it.

Please take a moment to share the article with your friends or leave a comment. We will sincerely thank you for your support!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/974658.htmlTechArticlePublish Weibo instances using OAuth authentication of Sina Weibo API, apioauth Continue with the previous article "Sina Weibo OAuth Authentication "Detailed explanation of the main process of storage and storage", now we use it to publish micro...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1662
14
PHP Tutorial
1261
29
C# Tutorial
1234
24
Python server programming: using django-allauth to implement OAuth authentication Python server programming: using django-allauth to implement OAuth authentication Jun 18, 2023 am 11:27 AM

In modern Internet applications, user authentication and authorization are very important factors. The OAuth (Open Authorization) protocol is one of the most commonly used authentication and authorization protocols in modern Internet development. This article will introduce how to implement OAuth authentication using Python's web framework Django and a package called django-allauth. Django is a free and open source web application framework written in Python. It can help developers quickly build high-quality web applications.

How to create a group chat on Sina Weibo app How to create a group chat on Sina Weibo app How to create a group chat on Sina Weibo app How to create a group chat on Sina Weibo app Mar 14, 2024 pm 09:31 PM

How to create a group chat on Sina Weibo app? Sina Weibo app is a software that allows users to socialize on this software. Users can follow each other here and send private messages to other users here. In other words, users can socialize on this software. Chat. In addition, this software also allows users to create group chats and then chat. Many users still don’t know how to create a group chat. The editor below has compiled methods for creating group chats for your reference. How to create a group chat on Sina Weibo app 1. First, open the software, find and click the "Gear" option in the upper right corner of the "Message" interface; 2. Then, click on the pop-up option box

React Query Database Plugin: A Guide to Integrating with OAuth Authentication React Query Database Plugin: A Guide to Integrating with OAuth Authentication Sep 26, 2023 pm 02:27 PM

ReactQuery Database Plugin: A Guide to Integrating with OAuth Authentication Introduction: ReactQuery is a powerful tool for managing data in React applications. It provides a concise and flexible way to handle data query, caching and data state management. To further enhance the functionality of ReactQuery, we can combine it with the OAuth authentication mechanism to ensure data security and consistency. This article will introduce how to

How to activate Sina Weibo membership_Introduction to how to activate Sina Weibo membership How to activate Sina Weibo membership_Introduction to how to activate Sina Weibo membership Mar 29, 2024 pm 07:26 PM

1. Log in to Weibo, view personal information, and click on the small crown icon, as shown in the picture. 2. Click to activate membership. 3. Select your activation time and payment method and click Confirm to activate. After reading the above related methods on how to activate Sina Weibo membership, you should be able to do it yourself.

Use PHP to implement a crawler that captures Sina Weibo user information Use PHP to implement a crawler that captures Sina Weibo user information Jun 13, 2023 pm 12:06 PM

In recent years, with the rapid development of mobile Internet, social networks have become an indispensable part of people's daily lives. Among them, Weibo, as one of the well-known social media in China, has extensive influence among user groups. However, since Sina Weibo restricts users from independently applying for developer permissions, the difficulty of collecting information has increased to a certain extent. Therefore, in order to solve this problem, this article will introduce a crawler method that uses PHP to crawl Sina Weibo user information. 1. Overview of the crawler process The crawler process introduced in this article is as follows:

Xiaoji Dictionary lost the first instance of its 'plagiarism case' against Sina Weibo. The founder said that 'although he will continue to appeal, there is little hope of winning.' Xiaoji Dictionary lost the first instance of its 'plagiarism case' against Sina Weibo. The founder said that 'although he will continue to appeal, there is little hope of winning.' Sep 19, 2023 am 11:13 AM

The content that needs to be rewritten on this site is: 9 The content that needs to be rewritten is: Month The content that needs to be rewritten is: 18 The content that needs to be rewritten is: Daily news, Xiaoji Dictionary originated from The content that needs to be rewritten is: 2017 needs The rewritten content is: Nian is an open buzzword encyclopedia editing website. This website reported at the beginning of this year that the company was allegedly "plagiarized by Sina Weibo, so it sued for infringement, but was sued by Sina Weibo and was forced to "Shut down" and claimed that it would "not stop safeguarding rights." However, the company's appeal to the first-instance judgment has been dismissed. It is reported that the content that needs to be rewritten in 2021 is: The content that needs to be rewritten is: 5 The content that needs to be rewritten is: In March, Xiaoji Dictionary found that its entry was "plagiarized" by the new section of the Weibo International version of the encyclopedia. , “The total amount of plagiarized content is as high as

Yu Chengdong's first native Hongmeng Weibo hit the hot search list: Worth remembering Yu Chengdong's first native Hongmeng Weibo hit the hot search list: Worth remembering Jun 22, 2024 pm 08:35 PM

According to news on June 22, the topic "Yu Chengdong's first native Hongmeng Weibo" rushed to the hot search list. During the 2024 Huawei Developer Conference, Yu Chengdong invited Weibo CEO Wang Gaofei to visit the HDC exhibition area. The on-site staff introduced and showed them the development results of the Hongmeng version of Weibo. Yu Chengdong got started and experienced and posted his first Weibo from native Hongmeng. Yu Chengdong said that this Weibo is also my first native Hongmeng Weibo and is worth remembering. Thanks to Weibo's excellent development team, it took only 8 weeks to quickly complete the development of core functions. The current version already has some new experiences brought by native Hongmeng. You can look forward to the commercial version released later this year.​​​​​​​​​​​​​​​​​

Done! Here comes another artificially retarded person who replies indiscriminately and breaks the defense of Weibo V. Done! Here comes another artificially retarded person who replies indiscriminately and breaks the defense of Weibo V. Jul 12, 2024 pm 05:20 PM

Machine Power Report Editor: Yang Wen’s talkative AI assistant doesn’t understand the world at all. Everyone else is crazily posting big models, AI videos, and AI photos, but Sina Weibo is the only one who is blindfolded and crazy about commenting on a small robot. Following the cyber gai "Comment on Robert", Weibo has launched another AI assistant. Weibo's official design for it is as follows: the AI ​​assistant can learn the blogger's language style based on the historical content posted by the blogger, and reply to fans' comments in the blogger's tone, or chat with fans. Ideal is full, the reality is very skinny. This little AI assistant doesn't play according to the routine, and its little mouth is like a poison, destroying every human being who gasps. -1-The donkey’s lips are wrong and the horse’s mouth is blind. Recently, Weibo is testing a product with low traffic.

See all articles