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

Using the WWW Class with the Twitter Stream

Discussion in 'Scripting' started by Rooch, Feb 21, 2014.

  1. Rooch

    Rooch

    Joined:
    Sep 4, 2013
    Posts:
    3
    Afternoon all,

    I'm trying to create a visualisation of live Twitter data, with the connection to the Twitter stream API embedded the in the Unity application. It will eventually be deployed on a Linux system.

    I spent this morning wrestling with OAuth and was eventually able to post a tweet, but I'm having trouble with streaming.

    It seems that the WWW class blocks any access to the data returned from the server until the connection has been closed. However, the Twitter stream keeps the connection open indefinitely.

    Is there any way of accessing the data as it arrives rather than waiting for the connection to close? I did start looking at HTTPWebRequest, but ran into problems with https.

    Any help would be greatly appreciated.

    Cheers
    C
     
  2. The_Natural_Tanuki

    The_Natural_Tanuki

    Joined:
    Oct 14, 2015
    Posts:
    6
    I'm also trying to use Twitter stream api within Unity. So here's a bump. I'm looking for any clue as to how to procede or any useful example.
     
  3. monosaicol

    monosaicol

    Joined:
    Jan 29, 2014
    Posts:
    1
    Has this being solved? I am currently working with Node.js writing down the data I need then reading it, but that is getting a bit overwhelming for the machine specially for real time data. I want to swap that and make a direct connection with Unity, is there anything out there for that?
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,644
    I think what you are looking for is UnityWebRequest with DownloadHandlerScript.
     
  5. Chris-HG

    Chris-HG

    Joined:
    Aug 10, 2012
    Posts:
    63
    Which Twitter API libs are you guys using?