I would like to extract tweets from twitter for a specific timerange, help me! How could i do?

1 回表示 (過去 30 日間)
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?

採用された回答

Puru Kathuria
Puru Kathuria 2020 年 3 月 13 日
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 件のコメント
Rachele Franceschini
Rachele Franceschini 2020 年 4 月 23 日
編集済み: Rachele Franceschini 2020 年 4 月 23 日
Thank you for your answer and i am sorry for my late. But that method is for tweets in real time. How do i do to have tweets in the past or in specific period time?... Such as, i would like to extract tweet since 12-12-2015 to 12-01-2016. How can i do?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by