I'm in the process of building a twitter feed for my website using the utwit library. Overall it works well, except for the fact that the media data is missing from the Entities property of the Status object for tweets which contain an image.
This is true whether or not the tweet with an image in it is a retweet. When I inspect the returned object in visual studio, the entities object only contains urls, hashtags and user mentions (in agreement with the Entities definition in the Status model). The Twitter API itself contains additional properties (as detailed here: https://dev.twitter.com/overview/api/entities-in-twitter-objects).
Is there something extra I need to do in order to fetch the media information of a tweet with an image in it, or is this just an omission from the utwit API? The request I am using is built up as follows:
var config = SettingsNode.GetPropertyValue
var tweets = GetLatestTweets(config, 4, true, true)
Unfortunately it doesn't look like uTwit currently supports Media entities so you would need to wait for a possible future update to the component. Maybe put a request in on Git for the feature to be added!!
Thanks for your reply. I'll probably have to use another Twitter library or access the Twitter API directly, as I don't have much time left to find a solution.
If you want to display images, you will need to pull down the code for Utwit from github, and copy the code, i have added in the pull request. You will then need to compile the utwit solution, which will then give you a custom utwit dll.
copy the uTwit Dll into your project's bin folder, and you will then be able to access the media properties in your code.
Hope that helps in the meantime, until Matt can update the project to merge the pull request.
How do I retrieve media entities?
I'm in the process of building a twitter feed for my website using the utwit library. Overall it works well, except for the fact that the media data is missing from the Entities property of the Status object for tweets which contain an image.
This is true whether or not the tweet with an image in it is a retweet. When I inspect the returned object in visual studio, the entities object only contains urls, hashtags and user mentions (in agreement with the Entities definition in the Status model). The Twitter API itself contains additional properties (as detailed here: https://dev.twitter.com/overview/api/entities-in-twitter-objects).
Is there something extra I need to do in order to fetch the media information of a tweet with an image in it, or is this just an omission from the utwit API? The request I am using is built up as follows:
var config = SettingsNode.GetPropertyValue
var tweets = GetLatestTweets(config, 4, true, true)
Any help would be appreciated.
Unfortunately it doesn't look like uTwit currently supports Media entities so you would need to wait for a possible future update to the component. Maybe put a request in on Git for the feature to be added!!
Thanks for your reply. I'll probably have to use another Twitter library or access the Twitter API directly, as I don't have much time left to find a solution.
+1 on that feature request.
Looking at the source code, it appears to just need the media models building to wrap the json response inside.
Ive added the media entity code as a pull request fyi :) https://github.com/mattbrailsford/uTwit/pull/2
I would like to do the same for Umbraco version of uTwit. If anyone can help with this would be much appreciated.
Hi @Gavin,
If you want to display images, you will need to pull down the code for Utwit from github, and copy the code, i have added in the pull request. You will then need to compile the utwit solution, which will then give you a custom utwit dll.
copy the uTwit Dll into your project's bin folder, and you will then be able to access the media properties in your code.
Hope that helps in the meantime, until Matt can update the project to merge the pull request.
Ric
I have the updated plugin that show profile images though I was trying to find if we could pull images from tweets.
If not don't worry cause its only a optional extra.
is working on a reply...