I have been playing with Linq to twitter for a while now. I have the code working fine to upload media, in my case I am uploading images. This will be automated and I get the people I tag from our list of followers.
What I want to do is to "tag" followers in my image upload. In twitter parlance it is known as - who is in this photo" In the normal browser you may add/tag ten people in the photo.
I cannot seem to find any overload in the LinkToTwitter functions. I suspect it may be the additional owners, but the description does not make sense to me.
I looked for overloads in the TweetAsync, but there does not seem to be anything there that I can use. I suspect that it will be a List that I will add to an overload, but which overload?
My code is as follows:
static async Task<Status> UploadMultipleImagesAsync(string file)
{
var auth = new SingleUserAuthorizer
{
CredentialStore = new SingleUserInMemoryCredentialStore
{
ConsumerKey = "xxx",
ConsumerSecret = "xxx",
AccessToken = "xxx",
AccessTokenSecret = "xxx"
}
};
var context = new TwitterContext(auth);
var additionalOwners = new List<ulong> { 3265644348, 15411837 };
string status = "Some light humour for my awesome Tweeps. Almost #beeroclock #prost";
var imageUploadTasks =
new List<Task<Media>>
{
context.UploadMediaAsync(File.ReadAllBytes(file), "image/jpg"),
};
await Task.WhenAll(imageUploadTasks);
var mediaIds =
(from tsk in imageUploadTasks
select tsk.Result.MediaID)
.ToList();
Status tweet = await context.TweetAsync(status, mediaIds);
if (tweet != null)
Console.WriteLine("Tweet sent: " + tweet.Text);
return tweet;
}
Any help or ideas on how to go about this would be greatly appreciated.