How to extract tweets given an ID
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi
I am currently working on a project which demands analysing tweet data. For this, I have dopwnloaded a dataset which supposeldy containing the tweets as well as the category assigned against each tweet. However, after downloading the dataset I found it conatins some ID's and the assigned category. I have attached a snapshot of the dataset following:
Until now, I have tried this following sample code:
baseurl = 'https://api.twitter.com/1.1/statuses/show.json';
parameters.count = 1;
d = getdata(c,baseurl,parameters,'id','567824878201511000');
which shows error after execution. The error is following:
Error using char
Conversion to char from struct is not possible.
Error in twitter/getdata (line 73)
requestParams.(char(varargin{i})) = varargin{i+1};
Error in tweetRetreat (line 60)
d = getdata(c,baseurl,parameters,'id','567824878201511000');
I am pretty doubtdul how to extract tweets against each number from the dataset after creating the twitter credentials. Does anyone of you advice me in this regard?
thanks,
2 comentarios
Guillaume
el 22 de Ag. de 2019
which shows error after execution
And the full text of the error is...
Respuestas (1)
Steven Lord
el 22 de Ag. de 2019
Looking at the definition of the getdata method for twitter objects I suspect you want to either specify a number for the 'id' query parameter or query using the 'id_str' parameter. If you look at the struct array containing user data in the "Retrieve Twitter Data Using Name-Value Arguments" example on that page, it lists the account identifier in two ways.
FYI, this post on Loren Shure's blog may be of interest to you, as it deals with using Text Analytics Toolbox to analyze Twitter data retrieved using Datafeed Toolbox. Perhaps it could suggest tools and/or techniques for your analysis.
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!