views:

354

answers:

3

Hi,

I am trying to use Tweetsharp to do a search on twitter for specific keywords but I want to do a search on multiple keywords. The following code works but only for one keyword. Anyone would know how to do an "or" search with tweetsharp?

ITwitterLeafNode searchQuery = FluentTwitter.CreateRequest() .Search().Query() .ContainingHashTag("heart") .Since(sinceID) .InLanguage("EN") .Take(tweetCount) .AsJson();

var results = searchQuery.Request().AsSearchResult();

+2  A: 

Twitter's standard search operators seem to work fine with TweetSharp, so you could use the Containing() method instead:

var qry = FluentTwitter.CreateRequest()
                       .Search().Query()
                       .Containing("#heart OR #soul");

Note that the "OR" needs to be in capitals.

Matt Hamilton
Thank you that is actually perfect. I would have loved an answer where I don't have to build the sear4ch string but it works. Thank you again
yveslebeau
+1  A: 

Whoops. Looks like we forgot to implement OR. Most people use "Containing" as a rote query expression like Matt has demonstrated. If you want us to add more extensions for boolean operators, let us know by filing a bug.

Daniel Crenna
Thank you, I will definitely do that. We have worked with TweetSharp and really like it, just would like some few extra stuff added.
yveslebeau
A: 

I've posted a sample code on my blog. http://www.fairnet.com/post/2010/07/08/Building-Twitter-Application-using-TweetSharp.aspx

Farooq Kaiser