Hey, everyone! I’ve been following this amazing tutorial: Getting Twitter messages into TouchDesigner - YouTube
The thing is that at the moment of trying to parse the data incoming from Twitter, it doesn’t work (it doesn’t parse anything, it returns me the whole dictionary), no matter how exactly close I get to the example in the tutorial.
I’ll paste the “TwitterFeedExt” DAT to see if anyone can find the mistake:
from TDStoreTools import StorageManager
import TDFunctions as TDF
import json
class TwitterFeedExt:
"""
TwitterFeedExt description
"""
def __init__(self, ownerComp):
# The component to which this extension is attached
self.ownerComp = ownerComp
def ParseTweet (self, data):
# This will parse the json data incoming from the tweets
for data in data.splitlines():
jsonDict = json.loads(data)
# Parse this tweet for text, hashtags and userinfo
dataDict = {}
dataDict['id'] = jsonDict.get('id', None)
dataDict['text'] = jsonDict.get('text', None)
debug(dataDict)
return