Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Display Twitter Post

Discussion in 'Scripting' started by Malleck666, Nov 28, 2016.

  1. Malleck666

    Malleck666

    Joined:
    Jan 9, 2015
    Posts:
    235
    Hi,

    I've searched about for a while but I'm yet to find a clear answer.
    Is it at all possible to simply display a tweet as text within an application built in Unity?

    For example, a home screen which shows the latest tweet from a given account.

    I've looked at tools such as Fabric, but they seem convoluted and unnecessary. Ideal, I'd like to be able to achieve this without additional plugins etc.

    I'm an able coder so a point in the right direction should set up me up nicely.

    Thanks in advance.
     
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,146
    I doubt you can do this without a plugin, but I'm not sure I know what you are looking for. Do you mean read a tweet from someones post and then transfer that to a Unity text?

    You'll need to look at the twitter api and it may require their plugin, which I"m pretty sure is required to do a post, so reading a post would make sense here. While it could be possible to use an http get or something to get the text, there may be no way to target to get anything.
     
  3. Defero

    Defero

    Joined:
    Jul 9, 2012
    Posts:
    200
    Yes as @Brathnann said, you have to use the twitter API for that. Which now has a OAuth 2.0 authentication for application use (1.1 for user functions).
    Fabric is there for ease of use, but you can write your own if you wish. But you'll have to implement your own (https://dev.twitter.com/oauth/application-only)

    A Http Get is a bad idea. It might work today, but stop tomorrow. So you'll be at the mercy of your html parser and twitter changes to their website.