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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:40:13+00:00 2026-06-05T01:40:13+00:00

I did a Twitter crawler using the Streaming API. It is programmed in perl

  • 0

I did a Twitter crawler using the Streaming API. It is programmed in perl using the Net:Twitter:Stream. I think it is retrieving few tweets. I left it tracking TV series tweets last night and I got just 30860 tweets. I think it’s a low value.
What do you think about it? Is there any other perl library that I can use?
I’ll put part of my code here to see if there is something wrong.

Thanks everybody

Thiago

use JSON;
use Solr;
use Net::Twitter::Stream;
sub coletar{
    Net::Twitter::Stream->new ( user => $username, pass => $password,
                    callback => \&got_tweet,
                    connection_closed_cb => \&connection_closed,
                    track => $track); #$track has my string search;
    sub connection_closed {
        if ($count==0){
           sleep 10;
        }
        elsif($count==1){
           sleep 20;
        }
        else{
           sleep 240;
        }
        $count++;
        warn "Connection to Twitter closed";
        coletar();              #Recomeçando o download de tweets.
    }
    sub got_tweet {
        $cont=0;
        my ( $tweet, $json ) = @_; 
        # Here I save the tweet in my NoSQL database...
    }
}
coletar;
  • 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-05T01:40:14+00:00Added an answer on June 5, 2026 at 1:40 am

    There are a few things to keep in mind about the Twitter stream. First of all, if your code is a bottleneck, the queue of incoming tweets will overflow and your connection will die. So it very well may not be your code.

    Twitter is limiting the number of Tweets they give to “regular” consumers, and charging for full streams. So you may be hitting rate limits, but it’s hard to be sure.

    One way to test what percentage of tweets you are getting is to set up a second account that randomly sends tweets that should be caught in your filter. Then count the percentage of those Tweets that are caught in your scraper. If it is not 100%, you are probably getting rate limited.

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

Sidebar

Related Questions

I've been using the Twitter search api and PHP to pull in tweets from
Twitter's Streaming API seems to provide a way to receive realtime tweets without constantly
Currently did ios5 twitter integration in my app using Sharekit framework but I came
Does (or did) Twitter ever have a method in their API that allowed client-side
I'm trying to do AJAX on Twitter REST API (JSON Format). I did the
I'm using php-twitter (Billingham et al) to fiddle with the Twitter API and came
Did a lot of research on this. Saw several opinions, few say I need
Did some searches here & on the 'net and haven't found a good answer
I am new to the Twitter API and iOS, but reading the documentation I
I am new to Twitter API and only know that we can pull someone's

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.