【问题标题】:Linq To Twitter - Who's in this photoLinq To Twitter - 谁在这张照片中
【发布时间】:2016-05-06 21:35:17
【问题描述】:

我玩 Linq to twitter 已经有一段时间了。我的代码可以正常上传媒体,就我而言,我正在上传图片。这将是自动化的,我会从我们的关注者列表中获取我标记的人。

我想做的是在我的图片上传中“标记”关注者。在 twitter 的说法中,它被称为 - 谁在这张照片中”在普通浏览器中,您可以在照片中添加/标记十个人。

我似乎在 LinkToTwitter 函数中找不到任何过载。我怀疑它可能是额外的所有者,但描述对我来说没有意义。

我在 TweetAsync 中寻找重载,但那里似乎没有我可以使用的任何东西。我怀疑这将是一个列表,我将添加到一个重载中,但是哪个重载?

我的代码如下:

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;            
    }

任何有关如何解决此问题的帮助或想法将不胜感激。

【问题讨论】:

    标签: c# linq-to-twitter


    【解决方案1】:

    自 3 月 22 日起,它们不支持通过 API 进行标记

    https://twittercommunity.com/t/twitter-new-photo-tagging-feature/13023/12

    【讨论】:

      猜你喜欢
      • 2015-07-23
      • 1970-01-01
      • 2015-09-30
      • 2021-09-10
      • 1970-01-01
      • 2015-01-16
      • 1970-01-01
      • 1970-01-01
      • 2020-02-16
      相关资源
      最近更新 更多