Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

Tweet attributes

Francesco Poldi edited this page Mar 4, 2020 · 6 revisions

Attributes

Here we can see every attribute that a tweet object can have. You can access this attributes via dot notation (Tweet.id).

These attributes can be used when formatting the output (config.Format) and customizing the fields to save in the files (config.Custom["tweet"]).

- {id}
- {conversation_id}
- {created_at}
- {datestamp}
- {timestamp}
- {timezone}
- {user_id}
- {username}
- {name}
- {place}
- {tweet}
- {mentions}
- {urls}
- {photos}
- {replies_count}
- {retweets_count}
- {likes_count}
- {hashtags}
- {cashtags}
- {link}
- {retweet}
- {quote_url}
- {video}
- {user_rt_id}
- {near}
- {geo}
- {source}
- {retweet_date}

Formatting and customizing

tweet objects are returned while scraping for tweets, so when one of these functions is used:

  • twint.run.Search
  • twint.run.Profile
  • twint.run.Favorites

Examples

Formatting

import twint

c = twint.Config()
c.Username = "username"
c.Format = "ID {id} | Username {username}"

twint.run.Search(c)

Customizing

import twint

c = twint.Config()
c.Username = "username"
c.Custom["tweet"] = ["id", "username"]
c.Output = "tweets.csv"
c.Store_csv = True

twint.run.Search(c)

Warning

Please remember that Twitter limits how much you can scroll in the user's timeline. So you might not be able to get all the tweets while running .Profile or .Favorites