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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:00:44+00:00 2026-06-01T01:00:44+00:00

All, I have the following code: $context = stream_context_create(array( ‘http’ => array( ‘timeout’ =>

  • 0

All,
I have the following code:

$context = stream_context_create(array(
    'http' => array(
        'timeout' => 5      // Timeout in seconds
    )
));
$username = $options['account'];
$contents = file_get_contents( "https://api.twitter.com/1/statuses/user_timeline.json?screen_name={$username}&count=1", 0, $context );

When I execute this code it works fine. However when I change the contents to this:

$how_many = $options['how_many'];
$contents = file_get_contents( "    
https://api.twitter.com/1/statuses/user_timeline.json?screen_name={$username}&count={$how_many}", 0, $context );

I get the following error:

Warning: file_get_contents(https://api.twitter.com/1/statuses/user_timeline.json?screen_name=Username&count=10) [function.file-get-contents]: failed to open stream: No error

Any ideas why it would work for one and not for the other. If I copy and paste that URL into a browser results are returned as well.

  • 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-01T01:00:46+00:00Added an answer on June 1, 2026 at 1:00 am

    I ended up using cURL to get all of the values and it worked.

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

Sidebar

Related Questions

I have the following code to zip all the files and then save it
I have the following code: // Obtain the string names of all the elements
I have the following code to assign a value to all the elements of
i have the following code def get(self): date = datetime.date.today() loc_query = Location.all() last_cursor
I have the following code, but it doesn't put the scrolling div anywhere. All
To select all Scheduling s which are active, I have the following code: var
Hi all i have the following bit of code, which is used to generate
I have the following code in my activity: ...... DataCell[i] = new TextView(context,null,R.style.TitleRow); DataCell[i].setText(data[i]);
I have the following code in my context, and no explicit table-class mapping, yet
I have the following code: Tag.find_all_by_company_id(4).each.collect{|tag| tag.name }.join(,) (Essentially I'm trying to build a

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.