{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import sys\n", "sys.path.append(\"..\")" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "#### Import" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "from finnlp.data_sources.social_media.twitter import Twitter_Downloader" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "#### Config" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "stock = \"AAPL\"\n", "start_date = \"2023-01-01\"\n", "end_date = \"2023-01-05\"" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "#### Downloader" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "downloader = Twitter_Downloader()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "f95d73d68fff4354aadfd0482bb52952", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/5 [00:00\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
created_atidid_strfull_texttruncateddisplay_text_rangeentitiesextended_entitiessourcein_reply_to_status_id...retweetedpossibly_sensitivepossibly_sensitive_editablelangsupplemental_languageself_threadquoted_status_idquoted_status_id_strquoted_status_permalinkcard
02023-01-01 01:25:43+00:00160936018469415731216093601846941573122022 was the birth this movement. 2023 is when...False[0, 147]{'hashtags': [{'text': 'SPY', 'indices': [97, ...NaN<a href=\"https://mobile.twitter.com\" rel=\"nofo...1609360182714241024...FalseNaNNaNenNone{'id': 1609360176640925699, 'id_str': '1609360...NaNNaNNaNNaN
12023-01-01 03:20:49+00:0016093891512538357771609389151253835777たくさんコメントありがとうございました☺️False[0, 21]{'hashtags': [], 'symbols': [], 'user_mentions...NaN<a href=\"http://twitter.com/download/iphone\" r...None...FalseNaNNaNjaNoneNaNNaNNaNNaNNaN
22023-01-01 04:21:54+00:0016094045228033638461609404522803363846The fall of Apple iphone market share.\\n- peak...False[0, 212]{'hashtags': [], 'symbols': [{'text': 'AAPL', ...{'media': [{'id': 1609404518500032514, 'id_str...<a href=\"http://twitter.com/download/iphone\" r...None...FalseFalseTrueenNone{'id': 1609404522803363846, 'id_str': '1609404...NaNNaNNaNNaN
32023-01-01 04:32:23+00:0016094071636714004481609407163671400448Apple iphone market share peaked in H1 2009 an...False[0, 160]{'hashtags': [], 'symbols': [{'text': 'AAPL', ...{'media': [{'id': 1609407158696972289, 'id_str...<a href=\"http://twitter.com/download/iphone\" r...1609404522803363846...FalseFalseTrueenNone{'id': 1609404522803363846, 'id_str': '1609404...NaNNaNNaNNaN
42023-01-01 04:43:47+00:0016094100327347118091609410032734711809That sounds impossible if we look at how fast ...False[0, 272]{'hashtags': [{'text': 'iPhone', 'indices': [2...{'media': [{'id': 1609410028653645824, 'id_str...<a href=\"http://twitter.com/download/iphone\" r...1609407163671400448...FalseFalseTrueenNone{'id': 1609404522803363846, 'id_str': '1609404...NaNNaNNaNNaN
..................................................................
792023-01-04 21:45:11+00:0016107542370041897101610754237004189710APPLE $AAPL TO SIGN UP LUXSHARE TO PRODUCE IPH...False[0, 64]{'hashtags': [], 'symbols': [{'text': 'AAPL', ...NaN<a href=\"https://mobile.twitter.com\" rel=\"nofo...None...FalseNaNNaNenNoneNaNNaNNaNNaNNaN
802023-01-04 22:21:45+00:0016107634420921835851610763442092183585$AAPL https://t.co/Fb8UbPUy9SFalse[0, 5]{'hashtags': [], 'symbols': [{'text': 'AAPL', ...{'media': [{'id': 1610763438053068835, 'id_str...<a href=\"http://twitter.com/download/iphone\" r...None...FalseFalseTrueplNoneNaNNaNNaNNaNNaN
812023-01-04 22:53:05+00:0016107713243553464321610771324355346432$AAPL This doesn't fix their demand issues fol...False[0, 49]{'hashtags': [], 'symbols': [{'text': 'AAPL', ...{'media': [{'id': 1610771243019689984, 'id_str...<a href=\"https://mobile.twitter.com\" rel=\"nofo...None...FalseFalseTrueenNoneNaNNaNNaNNaNNaN
822023-01-04 23:10:20+00:0016107756689245839361610775668924583936These TOP companies have cash in the bank!\\n$A...False[0, 173]{'hashtags': [], 'symbols': [{'text': 'AAPL', ...NaN<a href=\"http://twitter.com/download/iphone\" r...None...FalseNaNNaNenNoneNaNNaNNaNNaNNaN
832023-01-04 23:10:46+00:0016107757770830069761610775777083006976Darvas strategy. \\n\\nPart 15• \\n\\nAlways speak...False[0, 122]{'hashtags': [], 'symbols': [{'text': 'MSFT', ...{'media': [{'id': 1610775771181682690, 'id_str...<a href=\"http://twitter.com/download/iphone\" r...None...FalseFalseTrueenNone{'id': 1610775777083006976, 'id_str': '1610775...NaNNaNNaNNaN
\n", "

84 rows × 38 columns

\n", "" ], "text/plain": [ " created_at id id_str \\\n", "0 2023-01-01 01:25:43+00:00 1609360184694157312 1609360184694157312 \n", "1 2023-01-01 03:20:49+00:00 1609389151253835777 1609389151253835777 \n", "2 2023-01-01 04:21:54+00:00 1609404522803363846 1609404522803363846 \n", "3 2023-01-01 04:32:23+00:00 1609407163671400448 1609407163671400448 \n", "4 2023-01-01 04:43:47+00:00 1609410032734711809 1609410032734711809 \n", ".. ... ... ... \n", "79 2023-01-04 21:45:11+00:00 1610754237004189710 1610754237004189710 \n", "80 2023-01-04 22:21:45+00:00 1610763442092183585 1610763442092183585 \n", "81 2023-01-04 22:53:05+00:00 1610771324355346432 1610771324355346432 \n", "82 2023-01-04 23:10:20+00:00 1610775668924583936 1610775668924583936 \n", "83 2023-01-04 23:10:46+00:00 1610775777083006976 1610775777083006976 \n", "\n", " full_text truncated \\\n", "0 2022 was the birth this movement. 2023 is when... False \n", "1 たくさんコメントありがとうございました☺️ False \n", "2 The fall of Apple iphone market share.\\n- peak... False \n", "3 Apple iphone market share peaked in H1 2009 an... False \n", "4 That sounds impossible if we look at how fast ... False \n", ".. ... ... \n", "79 APPLE $AAPL TO SIGN UP LUXSHARE TO PRODUCE IPH... False \n", "80 $AAPL https://t.co/Fb8UbPUy9S False \n", "81 $AAPL This doesn't fix their demand issues fol... False \n", "82 These TOP companies have cash in the bank!\\n$A... False \n", "83 Darvas strategy. \\n\\nPart 15• \\n\\nAlways speak... False \n", "\n", " display_text_range entities \\\n", "0 [0, 147] {'hashtags': [{'text': 'SPY', 'indices': [97, ... \n", "1 [0, 21] {'hashtags': [], 'symbols': [], 'user_mentions... \n", "2 [0, 212] {'hashtags': [], 'symbols': [{'text': 'AAPL', ... \n", "3 [0, 160] {'hashtags': [], 'symbols': [{'text': 'AAPL', ... \n", "4 [0, 272] {'hashtags': [{'text': 'iPhone', 'indices': [2... \n", ".. ... ... \n", "79 [0, 64] {'hashtags': [], 'symbols': [{'text': 'AAPL', ... \n", "80 [0, 5] {'hashtags': [], 'symbols': [{'text': 'AAPL', ... \n", "81 [0, 49] {'hashtags': [], 'symbols': [{'text': 'AAPL', ... \n", "82 [0, 173] {'hashtags': [], 'symbols': [{'text': 'AAPL', ... \n", "83 [0, 122] {'hashtags': [], 'symbols': [{'text': 'MSFT', ... \n", "\n", " extended_entities \\\n", "0 NaN \n", "1 NaN \n", "2 {'media': [{'id': 1609404518500032514, 'id_str... \n", "3 {'media': [{'id': 1609407158696972289, 'id_str... \n", "4 {'media': [{'id': 1609410028653645824, 'id_str... \n", ".. ... \n", "79 NaN \n", "80 {'media': [{'id': 1610763438053068835, 'id_str... \n", "81 {'media': [{'id': 1610771243019689984, 'id_str... \n", "82 NaN \n", "83 {'media': [{'id': 1610775771181682690, 'id_str... \n", "\n", " source in_reply_to_status_id \\\n", "0