Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Owain Williams 481 posts 1413 karma points MVP 7x c-trib
    Jun 09, 2015 @ 09:56
    Owain Williams
    0

    Show tweets with specific hashtag

    Hi! I've got the twitter feed working on my site but I wondered how I would go about just showing specific tweets, for example if they have a specific hashtag. I used to be able to do this on another CMS and was trying to work out out how to do it with Skybrud.Social but the examples I have found seem to be out of date.

    Any help / pointers would be great.

    Thanks,

  • Anders Bjerner 487 posts 2990 karma points MVP 8x admin c-trib
    Jun 16, 2015 @ 22:14
    Anders Bjerner
    101

    Hi Owain,

    You can make the search like:

    // Make the request to the API
    TwitterSearchTweetsResponse response = service.Search.GetTweets("#umbraco");
    
    // Iterate through the tweets
    foreach (TwitterStatusMessage tweet in response.Body.Statuses) {
    
        Console.WriteLine(tweet.Text);
        Console.WriteLine();
    
    }
    

    One of the problems with my package is that I haven't really had the time to write some proper documentation. I just launched a new site to sorta fix that (the site still lacks content), so you can see some further information on searching here: http://social.skybrud.dk/twitter/endpoints/search/query-based-search/

  • Owain Williams 481 posts 1413 karma points MVP 7x c-trib
    Jun 17, 2015 @ 09:56
    Owain Williams
    0

    Thanks Anders, that's great. I'll have a look at the site as well. Great work on the package - works really well.

    Would this search only pull back tweets with the hashtag which the user has posted or is this a full twitter search and it will show all tweets with a specific hashtag by anyone?

  • Anders Bjerner 487 posts 2990 karma points MVP 8x admin c-trib
    Jun 17, 2015 @ 10:57
    Anders Bjerner
    3

    The search is made across all tweets, and not just the user.

    If you want to limit the search to a specific user, I think you can use a query like #umbraco from:abjerner, but I haven't tested that.

  • Owain Williams 481 posts 1413 karma points MVP 7x c-trib
    Jun 17, 2015 @ 21:42
    Owain Williams
    2

    that works fine, you can also add more than one account in the search

     TwitterSearchTweetsResponse response = service.Search.GetTweets("#rbm from:account1 OR account2", 5);
    
  • sh00ks 6 posts 79 karma points
    Jun 17, 2016 @ 11:37
    sh00ks
    0

    This helped me out! Cheers both.

Please Sign in or register to post replies

Write your reply to:

Draft