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 8332923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:51:38+00:00 2026-06-09T02:51:38+00:00

I have twitter username and password. What I want is, when a client adds

  • 0

I have twitter username and password. What I want is, when a client adds any new article from the admin side I want its url be auto twit. I dont want to bother client to login to twitter each time he adds an article. Is there any way to auto login using Abraham twitteroauth library. Thankyou

  • 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-09T02:51:39+00:00Added an answer on June 9, 2026 at 2:51 am

    Twitter requires first to Authorize a client app, then you’ll able to auto-tweet on certain occasions (i.e. publishing new article). For a detailed depiction you may take a look at this Twitter module for Chyrp that I’ve created. It uses the Abraham’s Twitter oAuth library. There’s also a clear example inside the abraham’s library archive that may clear this up a bit.

    On the other hand, the CMS/Blog you’re using for your client’s site, should provide hooks (callbacks) in order to know when a post is being created, in order to call the Tweet method accordingly.

    Example from the linked Twitter module for Chyrp:

    1) Authorize with Twitter:

    static function admin_chweet_auth($admin) {
        if (!Visitor::current()->group->can("change_settings"))
            show_403(__("Access Denied"), __("You do not have sufficient privileges to change settings."));
    
        # If the oauth_token is old redirect
        if (isset($_REQUEST['oauth_token']) && $_SESSION['oauth_token'] !== $_REQUEST['oauth_token'])
        Flash::warning(__("Old token. Please refresh the page and try again."), "/admin/?action=chweet_settings");
    
        # New TwitteroAuth object with app key/secret and token key/secret from SESSION
        $tOAuth = new TwitterOAuth(C_KEY, C_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
        $access_token = $tOAuth->getAccessToken($_REQUEST['oauth_verifier']);
    
        # Save access tokens locally for future tweeting.
        $config = Config::current();
        $config->set("chweet_oauth_token", $access_token["oauth_token"]);
        $config->set("chweet_oauth_secret", $access_token["oauth_token_secret"]);
        $config->set("chweet_user_id", $access_token["user_id"]);
        $config->set("chweet_username", $access_token["screen_name"]);
    
        unset($_SESSION['oauth_token']);
        unset($_SESSION['oauth_token_secret']);
    
        if (200 == $tOAuth->http_code)
            Flash::notice(__("Chweet was successfully Authorized to Twitter."), "/admin/?action=chweet_settings");
        else
            Flash::warning(__("Chweet couldn't be authorized."), "/admin/?action=chweet_settings");
    }
    

    2) add_post (trigger)

    public function add_post($post) {
       fallback($chweet, (int) !empty($_POST['chweet']));
       SQL::current()->insert("post_attributes",
                        array("name" => "tweeted",
                              "value" => $chweet,
                              "post_id" => $post->id));
    
       if ($chweet and $post->status == "public")
           $this->tweet_post($post);
    }
    

    3) Tweet-it method (truncated).

    public function tweet_post($post) {
        $tOAuth = new TwitterOAuth(C_KEY, C_SECRET, $config->chweet_oauth_token, $config->chweet_oauth_secret);
        $user = $tOAuth->get("account/verify_credentials");
        $response = $tOAuth->post("statuses/update", array("status" => $status));
        return $response;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Django site in which the site admin inputs their Twitter Username/Password
i have the following code. Twitter t1 = new Twitter(twitteruser,password); TwitterUser user = t1.User.Show(username);
Consider this: require 'Twitter.class.php'; $tweet = new Twitter(username, password); foreach($comment as $key => $value)
I have the following code: $routes = array( 'twitter_output' => new Zend_Controller_Router_Route( 'twitter/:username\.:format', array('controller'
I have a very simple bit of jQuery to retrieve my latest Tweet $.getJSON(http://twitter.com/statuses/user_timeline/username.json?count=1,
I have twitter bootstrap setup to build in a new project, but am getting
I have multiple twitter share buttons on a page, I want to identify which
I have created Twitter bots for many geographic locations. I want to allow users
I have not used Twitter enough to become familiar with its terminology or the
I have file index.php , and I want to include file class.twitter.php inside it.

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.