abjerner / Skybrud.Social

Skybrud.Social is a framework in .NET for integration with various social services like Twitter, Facebook and Instagram. The framework will handle all the technical parts and API communication so you don't have to.
http://social.skybrud.dk/
MIT License
96 stars 32 forks source link

How to show original if the tweet was a retweet #60

Closed mistyn8 closed 7 years ago

mistyn8 commented 7 years ago

Hello, I can't seem to see any support for the retweeted_status tag that comes though from the raw json from twitter. So instead of showing the original tweeted and being able to add a retweeted by @user it just displays as if it was an original tweet. As this is contrary to twitter usage I'm a little stumped.. could you offer any guidance.

The additional issue with not being able to access the original is that the status.text gets truncated on the retweeted item. And in this instance that means the mediaurl is corrupted and no replacement available by the extension.

I've attached a sample json with a simple example.

thanks for you help in advance. retweeted_status.txt

abjerner commented 7 years ago

@mistyn8 The retweeted status is currently not supported (I can't remember that I have seen it before), but I will make sure to add support for it ;)

While the property is not directly supported yet, you can still get it from the underlying JSON. The code for this would look something like:

// Get the status message as before
TwitterStatusMessageResponse response = service.Statuses.GetStatusMessage(801188244704657408);

// Read and parse the "retweeted_status" property from the underlying JSON
TwitterStatusMessage retweeted = response.Body.JsonObject.GetObject("retweeted_status", TwitterStatusMessage.Parse);
abjerner commented 7 years ago

This is now part of v0.9.4.8

You can now use the RetweetedStatus property ;)