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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:42:42+00:00 2026-06-14T20:42:42+00:00

I have the following code written in node.js to access to the Twitter Streaming

  • 0

I have the following code written in node.js to access to the Twitter Streaming API. If I curl the URL below, it works. However, I cannot get it to work with my code.

var https = require('https');

https.request('https://USERNAME:PASSWORD@stream.twitter.com/1.1/statuses/sample.json', function(res) {
  res.on('data', function(chunk) {
    var d = JSON.parse(chunk);
    console.log(d);
  });
});

But I receive the following

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: connect EADDRNOTAVAIL
    at errnoException (net.js:642:11)
    at connect (net.js:525:18)
    at Socket.connect (net.js:589:5)
    at Object.<anonymous> (net.js:77:12)
    at new ClientRequest (http.js:1073:25)
    at Object.request (https.js:80:10)
    at Object.<anonymous> (/Users/jordan/Projects/twitter-stream/app.js:3:7)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)

If anyone can offer an alternative solution, or explain to me why this doesn’t work, I would be very grateful.

  • 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-14T20:42:43+00:00Added an answer on June 14, 2026 at 8:42 pm

    I recently faced the same problem .Here’s the soln

     var https = require('https');   
     var options = {   
       host : 'stream.twitter.com',   
       path : '/1.1/statuses/filter.json?track=bob',    
       method : 'GET',  
       headers : {   
       "Authorization": "Basic "+new Buffer("userName:passwd").toString("base64")
      }   
     };
     var request = https.request(options,function(response){   
       var body = '';
       response.on("data",function(chunk){    
        var tweet = JSON.parse(chunk);  
        console.log(tweet.text);  
      });  
     });  
     request.end();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written the following code using node.js and riak-js . I have a
I have written the following asp.net code ,How to access the value of minvalue
I have written following code to alert messages when Node.prototype.appendChild(obj) is called. var _appendChild
I have following code written to run NSTimer . But the NSTimer selector is
I'm using some not optimal code written by me... :-| I have following code:
I have written following code to attach gesture recogniser to multiple imageviews. [imageview1 setUserInteractionEnabled:YES];
I am trying my hands on WPF MVVM. I have written following code in
In physics library written in C# I have the following code: (in ContactManager.cs) public
i have written the following code class Program { static void Main(string[] args) {
I have written the following code, CrystalDecisions.CrystalReports.Engine.ReportDocument report = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); report.Load(@C:\Users\XXX\Desktop\Backup1\Project\ReportsFolder\ReportSalesInvoice.rpt); Report works

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.