I would like to extract tweets from twitter for a specific timerange, help me! How could i do?
2 views (last 30 days)
Show older comments
Rachele Franceschini
on 3 Mar 2020
Edited: Rachele Franceschini
on 23 Apr 2020
consumerkey = 'abcdefghijklmnop123456789';
consumersecret = 'qrstuvwxyz123456789';
accesstoken = '123456789abcdefghijklmnop';
accesstokensecret = '123456789qrstuvwxyz';
tw = twitter(consumerkey,consumersecret,accesstoken,accesstokensecret);
query = "superbowl";
d = search(tw,query,'count',100);
statuses = d.Body.Data.statuses;
tweet = statuses{1}.text
Using workflow:collecting and Analyzing Twitter Feed, How can i extract tweets inside the specific time-range?
0 Comments
Accepted Answer
Puru Kathuria
on 13 Mar 2020
Hi,
I understand that you want to extract tweets for a specific time range.
statuses = d.Body.Data.statuses;
%This will give you the timestamp using which you can filter your time range
statuses{1}.created_at
%Further, you can use this for making Timetable array with time-stamped rows and variables of different types
timetable(tweetTexts,'RowTimes',datetime(tweetTimes,'Format','eee MMM dd HH:mm:ss +SSSS yyyy'))
The following link might be of good help and might meet your requirements.
1 Comment
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!