Giter Site home page Giter Site logo

Comments (4)

linvi avatar linvi commented on July 20, 2024

Hi.

Thanks for reporting this issue.
Could you share your code please.

Also let me know which version of tweetinvi you are using.

Linvi

from tweetinvi.

tbduggan avatar tbduggan commented on July 20, 2024

Version 0.9.9.1

Did a little more investigation - it actually works if the tweet text length is under 118.

        // test
        byte[] image = System.IO.File.ReadAllBytes(@"C:\temp\testTweetImage.jpg");
        string text = "abcdefghijklmnopqrstuvwxy abcdefghijklmnopqrstuvwxy abcdefghijklmnopqrstuvwxy abcdefghijklmop" + "http://bit.ly/tinyurlwiki";
        int tl = text.TweetLength();
        var tweet = Tweet.PublishTweetWithImage(text, image);

play around by adding/subtracting characters to the last set of alphabet chars to see this succeed and fail.

from tweetinvi.

linvi avatar linvi commented on July 20, 2024

Hi this is not the correct way to calculate the size with media. Please do the following:

byte[] image = System.IO.File.ReadAllBytes(@"C:\temp\testTweetImage.jpg");
string text = "abcdefghijklmnopqrstuvwxy abcdefghijklmnopqrstuvwxy abcdefghijklmnopqrstuvwxy abcdefghijklmop" + "http://bit.ly/tinyurlwiki";

var publishParameter = new PublishTweetParameters(text)
{
    MediaBinaries = { image }
};

var tl = Tweet.Length(publishParameter); // returns 141

I will try to improve this in future releases.

from tweetinvi.

linvi avatar linvi commented on July 20, 2024

You can find the work item here.

from tweetinvi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.