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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:31:16+00:00 2026-06-03T17:31:16+00:00

require(twitteroauth/twitteroauth.php); session_start(); //Site Account $siteauth = new TwitterOAuth(‘{Consumer key}’, ‘{Consumer secret}’, ‘{Access token}’, ‘{Access

  • 0
require("twitteroauth/twitteroauth.php");  
session_start();
//Site Account
$siteauth = new TwitterOAuth('{Consumer key}', '{Consumer secret}', '{Access token}', '{Access token secret}');
$access_token = $siteauth->getAccessToken($_GET['oauth_verifier']);
$_SESSION['access_token'] = $access_token;
$site_info = $siteauth->get('account/verify_credentials');

var_dump($site_info);

I’m trying to create a $twitteroauth object in order to use the next code:

$follows_faelazo = $siteauth->get('friendships/exists', 'MY-VISTOTR-ACCOUNT', 'user_b' => 'MY-SITE_ACCOUNT'));
if(!$follows_faelazo){
    echo 'You are NOT following @faelazo!';
    $siteauth->post('friendships/create', array('screen_name' => 'MY-VISTOR'));
}

What I’m trying to do is to follow users who log in to my site using twitter, any idea what’s wrong? I’m kind of new with the twitter API.

  • 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-03T17:31:18+00:00Added an answer on June 3, 2026 at 5:31 pm

    please go to twitter dev – > My app – > Your App -> settings -> Application type set to Read, Write and Access direct messages.

    First you are checking if you have already followed the person. to do this 2 parameters are required ,.

     // uname
     1.) USER_FOLLOWING
     2.) USER_FOLLOWED
    

    Now the 2nd call will be to follow method so you could follow, for this 1 param is req.

    //this can be uid/uname
    1.) USER_T0_BE_FOLLOWED
    

    For above mentioned please make sure you are calling methods with appropriate param.

    e.g.) in the first you need to pass 4 param, client_id, client_secret , outhid, outhsecret

    initially before this user needs to authenticate the app.

    everything else lloks fine hope you passing proper param thats just one concern.

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

Sidebar

Related Questions

I am trying to use Twitter Oauth to login. index.php <?php require (twitteroauth/twitteroauth.php); session_start();
I use http://github.com/abraham/twitteroauth PHP library for reaching Twitter REST API: <?php session_start(); require(config.php); require(twitteroauth/twitteroauth.php);
require 'facebook.php'; $app_id =11111111111111111; $app_secret = 11111111111111111111111111; $facebook = new facebook(array( 'appId' => $app_id,
I'm using Abhraham's twitter API library. My index.php <?php ob_start(); session_start(); require_once 'twitteroauth/twitteroauth.php'; require_once
require_once 'library/facebook/facebook.php'; $facebook = new Facebook(array( 'appId' => 'appid', 'secret' => 'secret', )); $signed_request
require_once'modules/logger.php'; $Logger = new Logger(); require_once 'templates/list.php'; $Templates = new templatesList(); require_once 'widgets/list.php'; $Widgets
require_once('/recaptcha/recaptchalib.php'); was in the correct place but the error says: Warning: require_once() [function.require-once]: open_basedir
1) require 'sqlite3' db = SQLite3::Database.new('development.sqlite3') db.results_as_hash = true; rows = db.execute( SELECT *
require 'sketchup' entities = Sketchup.active_model.entities summa = Hash.new for face in entities next unless
I am using the function below function GetTwitterAvatarOauth($oauthtoken, $oauthsecret){ $to = new TwitterOAuth($consumerkey, $consumersecret,

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.