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

  • Home
  • SEARCH
  • 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 9027503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:45:42+00:00 2026-06-16T06:45:42+00:00

I’m trying to get the latest tweets from a particular user using PHP and

  • 0

I’m trying to get the latest tweets from a particular user using PHP and CURL and the new 1.1 API, I created my new App in the twitter website and went to the OAuth tool tab to generate the signature and according to the page it generates the following curl command:

curl --get 'https://api.twitter.com/1.1/statuses/user_timeline.json?count=2&screen_name=twitter' --header 'Authorization: OAuth oauth_consumer_key="Waqd223QDuge6l9UboBldg", oauth_nonce="8a9beae863838b0ba2bc6ac03bc9757e", oauth_signature="u2PrZ5g14HGb39pHoYl9azHp6vg%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1355408402", oauth_token="171967067-lyLujNed9QyVBfmlfAkFXiUt5KIQkqrCMwg6utFc", oauth_version="1.0"'

Which works fine in my terminal, however when I try to replicate it in PHP I get a “Could not authenticate you” error, this is what I have so far:

$options = array(
    URLOPT_HTTPHEADER      => array('Authorization: OAuth oauth_consumer_key="Waqd223QDuge6l9UboBldg", oauth_nonce="8a9beae863838b0ba2bc6ac03bc9757e", oauth_signature="toLnir5cHUUvEj8X29SdzjlOTXc%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="' . time() . '", oauth_token="171967067-lyLujNed9QyVBfmlfAkFXiUt5KIQkqrCMwg6utFc", oauth_version="1.0"'),
    CURLOPT_HEADER         => false,
    CURLOPT_URL            => 'https://api.twitter.com/1.1/statuses/user_timeline.json?count=2&screen_name=twitter',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_SSL_VERIFYPEER => false
);

$feed = curl_init();
curl_setopt_array($feed, $options);
$json = curl_exec($feed);
curl_close($feed);

$twitter_data = json_decode($json);

var_dump($twitter_data);

The only thing I’m changing is the oauth_timestamp where I use the time() function to get the current time, I figure I must be passing the wrong options to the curl function but I can’t figure it out.

Thanks in advance.

  • 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-16T06:45:43+00:00Added an answer on June 16, 2026 at 6:45 am

    Here you can find an example of getting tweets with the twitter api 1.1 and curl

    Simplest PHP example for retrieving user_timeline with Twitter API version 1.1

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

Sidebar

Related Questions

I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am using jsonparser to parse data and images obtained from json response. When

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.