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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:54:35+00:00 2026-05-15T02:54:35+00:00

How would you go to create a streaming API with Node ? just like

  • 0

How would you go to create a streaming API with Node? just like the Twitter streaming API.

What I want to do ultimately is get the first update from the FriendFeed api, and stream when a new one becomes available (if the id is different), and later on expose it as a web service so I can use it with WebSockets on my website :).

So far I have this:

var sys = require('sys'),
    http = require('http');

var ff = http.createClient(80, 'friendfeed-api.com');
var request = ff.request('GET', '/v2/feed/igorgue?num=1', 
                         {'host': 'friendfeed-api.com'});

request.addListener('response', function (response) {
    response.setEncoding('utf8'); // this is *very* important!
    response.addListener('data', function (chunk) {
        var data = JSON.parse(chunk);
        sys.puts(data.entries[0].body);
    });
});
request.end();

Which only gets the data from FriendFeed, creating the Http server with node is easy but it can’t return a stream (or I haven’t yet found out how).

  • 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-05-15T02:54:35+00:00Added an answer on May 15, 2026 at 2:54 am

    You would want to set up a system that keeps track of incoming requests and stores their response objects. Then when it’s time to stream a new event from FriendFeed, iterate through their response objects and responses[i].write('something') out to them.

    Check out LearnBoost’s Socket.IO-Node, you may even just be able to use that project as your framework and not have to code it yourself.

    From the Socket.IO-Node example app (for chat):

    io.listen(server, {
    
        onClientConnect: function(client){
            client.send(json({ buffer: buffer }));
            client.broadcast(json({ announcement: client.sessionId + ' connected' }));
        },
    
        onClientDisconnect: function(client){
            client.broadcast(json({ announcement: client.sessionId + ' disconnected' }));
        },
    
        onClientMessage: function(message, client){
            var msg = { message: [client.sessionId, message] };
            buffer.push(msg);
            if (buffer.length > 15) buffer.shift();
            client.broadcast(json(msg));
        }
    
    });
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a Django webapp that utilizes the Twitter Streaming API
I would like to get a byte[] from a float[] as quickly as possible,
I would like to set up a live streaming video demonstration. I have a
What i want to do is the following procedure: Get a frame from the
I am trying to use the Streaming API from php, I use the code
I'd like to create an API for a project I'm working on, allowing developers
I want to create an environment similar to the photo streaming in iCloud. When
I want to get data from a DMA enabled, PCIe hardware device into user-space
I would like to know how to create a signed URL for cloudfront. The
I would like to implement feature like GMail's get all attachments as zipped file.

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.