指定“from:twitterapi”时,我的TweetSharp搜索查询将不会返回推文

时间:2014-03-07 20:46:02

标签: vb.net search twitter tweetsharp

我正在尝试返回推文,并且在使用以下代码时我没有回复推文。将其更改为#twitterapi之类的内容时,我可以获得结果。我想要从特定用户那里获取推文,而不是搜索主题标签。

试图从@twitterapi搜索推文不会返回任何内容......

    Dim service As New TwitterService("xmxmxmxmxmxmx", "xmxmxmxmxmxmx")
    service.AuthenticateWith("xyxyxyxyx", "xyxyxyxyx")

    Dim SearchOptions As TweetSharp.SearchOptions = New TweetSharp.SearchOptions() With {.Q = "from:twitterapi", .Count = "30", .IncludeEntities = True}

    Dim Tweets As TweetSharp.TwitterSearchResult = service.Search(SearchOptions)

    For Each tweet As TweetSharp.TwitterStatus In Tweets.Statuses
        TwitterName.Text = tweet.User.ScreenName
        TwitterText.Text = tweet.Text
    Next

搜索#twitterapi会返回推文......

    Dim service As New TwitterService("xmxmxmxmxmxmx", "xmxmxmxmxmxmx")
    service.AuthenticateWith("xyxyxyxyx", "xyxyxyxyx")

    Dim SearchOptions As TweetSharp.SearchOptions = New TweetSharp.SearchOptions() With {.Q = "#twitterapi", .Count = "30", .IncludeEntities = True}

    Dim Tweets As TweetSharp.TwitterSearchResult = service.Search(SearchOptions)

    For Each tweet As TweetSharp.TwitterStatus In Tweets.Statuses
        TwitterName.Text = tweet.User.ScreenName
        TwitterText.Text = tweet.Text
    Next

任何人都知道我做错了什么或者我能尝试什么?谢谢!

1 个答案:

答案 0 :(得分:0)

要返回特定用户的推文,请尝试以下方式:

Dim service As New TwitterService("xmxmxmxmxmxmx", "xmxmxmxmxmxmx")
service.AuthenticateWith("xyxyxyxyx", "xyxyxyxyx")

Dim tweets As List(Of TweetSharp.TwitterStatus) = service.ListTweetsOnUserTimeline(New ListTweetsOnUserTimelineOptions() With {.Count = 5, .ScreenName = "twitterapi"})

希望这会有所帮助