Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9192503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:56:24+00:00 2026-06-17T20:56:24+00:00

I’m trying to make a PHP script that can post to groups on Sina

  • 0

I’m trying to make a PHP script that can post to groups on Sina Weibo, a Chinese Twitter clone. Other than group functionality, Weibo seems pretty much identical to Twitter in implementation (even in API) — hence I’m mentioning Twitter as the analogy, as the distinction’s irrelevant for my question.

I can make regular posts by API just fine, but the thing is, Weibo’s API does not support posting to groups, presumably due to potential spamming hazards that might entail. (Note: my intention wasn’t to spam millions with crap, but to get a script to automatically post info on patent expiries to relevant industry groups each day.)

Now, I know there should be a work-around, as there’s an application that allows one to manually post to groups (新浪微群自动群发精灵), though the source is private. So I tried to check the post form data sent to the server using Firebug to see if I could replace the API tweet command by manually making the PHP script replicate the post form info, but to no avail.

Here is my code for the callback.php file, called after establishing the OAuth connection. The working API method to post an update has been commented out in favor of the dysfunctional post form method (in HTML tags).

<?php
session_start();
include_once( 'config.php' );
include_once( 'saetv2.ex.class.php' );
$o = new SaeTOAuthV2( WB_AKEY , WB_SKEY );

if (isset($_REQUEST['code'])) {
    $keys = array();
    $keys['code'] = $_REQUEST['code'];
    $keys['redirect_uri'] = WB_CALLBACK_URL;
    try {       $token = $o->getAccessToken( 'code', $keys ) ;  } catch (OAuthException $e) {}
}

if ($token) {
    $_SESSION['token'] = $token;
    setcookie( 'weibojs_'.$o->client_id, http_build_query($token) );

    ?><html><head></head><body>
    <form action="http://www.weibo.com/aj/mblog/add?__rnd=1340066897833" method="post">
    <input type="hidden" name="_surl" value="">
    <input type="hidden" name="_t" value=0>
    <input type="hidden" name="location" value="home">
    <input type="hidden" name="module" value="stissue">
    <input type="hidden" name="pic_id" value="">
    <input type="hidden" name="rank" value="">
    <input type="text" name="text" value="测试发表微博 test message" />
    <input type="submit">
    </form></body></html><?

    /*
    $c = new SaeTClientV2( WB_AKEY , WB_SKEY , $_SESSION['token']['access_token'] );
    $msg = $c->update("测试发表微博 test message");
    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']." : ".$msg['text']." ".$msg["created_at"]);
    */

    } else echo('授权失败。 authentication failed');
?>

I’m pretty new to all of this, so I’m probably missing something obvious, but would anyone here know enough about Twitter/Weibo to locate the problem here? Would there perhaps be an easy workaround?
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:56:25+00:00Added an answer on June 17, 2026 at 8:56 pm

    Been a while, but for anyone stumbling upon this thread: by now I caught up a bit, and it seems like browser automation with Ruby gem Watir would have much better chances of working than form spoofing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
I have a small JavaScript validation script that validates inputs based on Regex. I
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.