Files
2023-04-13 19:28:37 +02:00

1.8 MiB

In [1]:
from database import connect as connect_database
from classes import Tweet

db = connect_database()
In [9]:
data = db.find_one({'account':'@Maersk'})
In [10]:
data.keys()
Out [10]:
dict_keys(['_id', 'account', 'url', 'time', 'text', 'images', 'video'])
In [11]:
tweet = Tweet.parse_obj(data)
In [12]:
tweet.account
Out [12]:
'@Maersk'
In [22]:
tweet.text
Out [22]:
"A spotless deck before delivery\nSusan Mærsk was built by Odense Steel Shipyard in 1954 and a final inspection of the ship takes place before delivery. The ship was deployed on The Far East service - the company's first liner service initiated in 1928.\n\n#Maerskheritage #Maersk"
In [14]:
len(tweet.images)
Out [14]:
4
In [25]:
tweet.images[0]
Out [25]:
In [26]:
tweet.images[1]
Out [26]:
In [27]:
tweet.images[2]
Out [27]:
In [28]:
tweet.images[3]
Out [28]:
In [19]:
db.count_documents({'account':'@Maersk'})
Out [19]:
5190
In [ ]:
In [ ]: