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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:49:07+00:00 2026-05-23T08:49:07+00:00

My web app requires users to cast votes via twitter and display those votes

  • 0

My web app requires users to cast votes via twitter and display those votes in a line chart. Id like to accomplish this whole thing using JavaScript.

My Requirements:

  • Using the twitter API, I need to Collect votes in real time and have those votes displayed in a line chart, in real time!
  • 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-23T08:49:08+00:00Added an answer on May 23, 2026 at 8:49 am

    Using the twitter API, I need to Collect votes in real time and have those votes displayed in a line chart, in real time!

    If you’re doing real time stuff, you want to use the Streaming API. It’s pretty easy to get up and running quickly using existing open-source client implementations like Phirehose. It comes with some great examples too.

    Here‘s their example that tracks a bunch of keywords: you’d probably want to track whatever hashtag people are voting on:

    <?php
    require_once('../lib/Phirehose.php');
    /**
     * Example of using Phirehose to display a live filtered stream using track words 
     */
    class FilterTrackConsumer extends Phirehose
    {
      /**
       * Enqueue each status
       *
       * @param string $status
       */
      public function enqueueStatus($status)
      {
        /*
         * In this simple example, we will just display to STDOUT rather than enqueue.
         * NOTE: You should NOT be processing tweets at this point in a real application, instead they should be being
         *       enqueued and processed asyncronously from the collection process. 
         */
        $data = json_decode($status, true);
        if (is_array($data) && isset($data['user']['screen_name'])) {
          print $data['user']['screen_name'] . ': ' . urldecode($data['text']) . "\n";
        }
      }
    }
    
    // Start streaming
    $sc = new FilterTrackConsumer('username', 'password', Phirehose::METHOD_FILTER);
    $sc->setTrack(array('morning', 'goodnight', 'hello', 'the'));
    $sc->consume();
    

    If you’re low volume, you could probably just shove the tweet right into the database in enqueueStatus.

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

Sidebar

Related Questions

I am building a web application on Google App Engine that requires users to
I am building an web app (with PHP) that requires users to subscribe. I
An Android app I am building requires web authentication for users to make data
Lets say you have a web app related Android app that requires the user
A web app I'm working on requires frequent parsing of diverse web resources (HTML,
Scenario: WCF client app, calling a web-service (JAVA) operation, wich requires a complex object
WEB APP not native, no Objective-C This is so simple it hurts. <input type=date
I have a rails app which requires users to verify that they own a
Right now I'm creating a web-app which requires that multiple sets of data (including
I am working on a web app that requires me to check if the

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.