WordPress.org

Ready to get started?Download WordPress

Forums

Tweeple
[resolved] Using Hashtag and Username? (6 posts)

  1. mstephans
    Member
    Posted 1 year ago #

    I would like a feed of my tweets that contain "#happyfor". Is there a way to do that?

    http://wordpress.org/extend/plugins/tweeple/

  2. Jason (Theme Blvd)
    Member
    Plugin Author

    Posted 1 year ago #

    I honestly do not know. --

    I know when you're fetching a user's timeline, Twitter API does not give you any way to add in any kind of search:

    https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline

    And when doing a search, according to the docs, you're supposed to be able to do this:

    from:you #happyfor

    https://dev.twitter.com/docs/using-search

    ... but I'm playing with this and it's very spotty. I can only get the ":from" to work with gigantic Twitter accounts like @twitterapi.

  3. Jason (Theme Blvd)
    Member
    Plugin Author

    Posted 1 year ago #

    This might help to explain why it's difficult to pull Tweets ":from" just any Twitter account with the Search API.

    https://dev.twitter.com/docs/faq#8650

  4. mstephans
    Member
    Posted 1 year ago #

    That's a shame. Looks like it isn't doable then. I would need something that parsed my timeline then did its own search of those outside of twitter. Oh well, thanks for checking!

  5. Jason (Theme Blvd)
    Member
    Plugin Author

    Posted 1 year ago #

    If you were to setup your own function from your own theme or plugin to display the tweets you can use Tweeple functionality something like this:

    function my_tweets() {
    
    	// The ID for the user timeline feed you setup in
    	// the admin. Maybe give it the max limit number.
    	$feed_id = 123;
    
    	$tweeple_feed = new Tweeple_Feed( $feed_id );
    	$feed = $tweeple_feed->get_feed();
    
    	foreach( $feed['tweets'] as $tweet ) {
    		if( false !== strpos( $tweet['text'], '#happyfor' ) ) {
    			//...
    		}
    	}
    
    }
  6. mstephans
    Member
    Posted 1 year ago #

    Thanks. Coding is going to be past my skill set though. I'll try and find another way, but I don't see one right now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.