Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Warren Lockhart 2 posts 72 karma points
    Jun 09, 2016 @ 13:22
    Warren Lockhart
    0

    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.

  • Graham Carr 277 posts 389 karma points
    Jul 04, 2016 @ 15:13
    Graham Carr
    0

    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!!

  • Warren Lockhart 2 posts 72 karma points
    Jul 04, 2016 @ 15:39
    Warren Lockhart
    0

    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.

  • Ric Carey 50 posts 93 karma points
    Jul 11, 2016 @ 10:21
    Ric Carey
    0

    +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.

  • Ric Carey 50 posts 93 karma points
    Jul 11, 2016 @ 12:12
    Ric Carey
    0

    Ive added the media entity code as a pull request fyi :) https://github.com/mattbrailsford/uTwit/pull/2

  • Gavin Hoare 11 posts 81 karma points
    Sep 28, 2016 @ 10:27
    Gavin Hoare
    0

    I would like to do the same for Umbraco version of uTwit. If anyone can help with this would be much appreciated.

  • Ric Carey 50 posts 93 karma points
    Sep 28, 2016 @ 15:20
    Ric Carey
    0

    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

  • Gavin Hoare 11 posts 81 karma points
    Sep 28, 2016 @ 16:06
    Gavin Hoare
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft