WordPress.org

Ready to get started?Download WordPress

Forums

Twitter Tracker
TwitterProfile::construct_profile_url (2 posts)

  1. Scott Kingsley Clark
    Member
    Posted 1 year ago #

    Please add to the construct_profile_url in TwitterProfile, the exclusion of replies. Otherwise, if a Twitter account consists of mostly replies at a given moment, the count won't matter and will only end up giving Twitter Tracker the non-replies along with replies, leaving the true tweets used -- less than the count was intended to return.

    The only drawback here is that Twitter's API is busted, if you say exclude replies, it's still return less than the count you specify to Twitter directly, as their code must be doing the exact same thing as Twitter Tracker :)

    Once they do fix their API though, this tweak will really kick in and increasing the max_tweets will no longer be necessary to pad for this eventuality. For now, I also suggest increasing the max_tweets to multiplying by 3.

    protected function construct_profile_url()
    	{
    		$include_retweets = $this->include_retweets ? 1 : 0;
    		$hide_replies = $this->hide_replies ? 1 : 0;
    		$url = 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=%s&count=%d&include_rts=%s&exclude_replies=%s';
    		$this->profile_url = sprintf( $url, urlencode( $this->username ), (int) $this->max_tweets * 3, $include_retweets, $hide_replies );
    	}

    http://wordpress.org/extend/plugins/twitter-tracker/

  2. Simon Wheatley
    Code for the People
    Plugin Author

    Posted 1 year ago #

    Thanks Scott, great suggestion, I wasn't aware of this API functionality.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.