Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Search 使用tweetsharp搜索多个关键字_Search_Keyword_Tweetsharp - Fatal编程技术网

Search 使用tweetsharp搜索多个关键字

Search 使用tweetsharp搜索多个关键字,search,keyword,tweetsharp,Search,Keyword,Tweetsharp,我试图使用Tweetsharp在twitter上搜索特定的关键词,但我想搜索多个关键词。以下代码适用于一个关键字。任何人都知道如何使用tweetsharp进行“或”搜索 ITwitterLeafNode searchQuery = FluentTwitter.CreateRequest() .Search().Query() .ContainingHashTag("heart") .Since(since

我试图使用Tweetsharp在twitter上搜索特定的关键词,但我想搜索多个关键词。以下代码适用于一个关键字。任何人都知道如何使用tweetsharp进行“或”搜索

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

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

Twitter的标准搜索操作符似乎可以与TweetSharp配合使用,因此您可以使用Containing()方法:

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

注意“OR”必须用大写。

哎呀。看来我们忘了执行或删除。大多数人使用“Containing”作为死记硬背的查询表达式,就像Matt所演示的那样。如果您希望我们为布尔运算符添加更多扩展,请提交一个bug通知我们。

谢谢,我一定会这样做。我们与TweetSharp合作过,非常喜欢它,只是想添加一些额外的东西。谢谢你,这真是太完美了。我希望有一个答案,我不必构建sear4ch字符串,但它可以工作。再次感谢你