简体   繁体   中英

What's the best C# Twitter API for a twitter bot

I'm writing a C# app that will be required to integrate with twitter, I need to be able to do the following:

  • send direct messages
  • read all messages that are either @helloapp or #helloapp

If you are interested the app is part of Carsonified 's app in 4 days for FOWA. Read more here or see the tweets .

TweetSharp can take care of both those requirements.

Yedda doesn't support Direct Messages as of now.

See available APIs here

I think most preferable will be Yedda Twitter Library

我更喜欢使用Twitterizer

Here is a better option if you are after a light-weight solution .

I wrote a Twitter Bot in C# for @valuetraderteam , it runs a heartbeat on a schedule and performs GET/POST actions to send website related tweets and add/remove friends from my list.

The API component in the GIST below is less than 500 lines, should be easy enough to add it to any project, only dependency is Json.NET which you might already have installed.

https://gist.github.com/sdesalas/c82b92200816ecc83af1

Hopefully this is useful to some other people out there.

I know that this post got marked as answered but I wanted to share how easy it is to send messages to multiple users at once with Tweetinvi ( http://tweetinvi.codeplex.com/ ).

IToken token = new Token("userKey", "userSecret", "consumerKey", "consumerSecret");
ITokenUser u = new TokenUser(token);
// Publish Direct Message to all the followers
u.PublishMessage("Hello world!", u.followers);
// Done!

I believe this can be of great help to develop a twitter bot.

Another option is LINQ to Twitter . This is a 3rd party LINQ provider that I created that allows developers to interact with the Twitter API. If you're writing a C# application to interact with Twitter, this is another option in addition to the other libraries mentioned in other posts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM