Twint: [QUESTION] Is conversation_id not working?

Created on 27 Jul 2019  路  2Comments  路  Source: twintproject/twint

Initial Check

  • [x] Specified it as a [QUESTION]

Make sure you've checked the following:

  • [x] Python version is 3.6;
  • [x] Updated Twint with pip3 install --user --upgrade -e git+https://github.com/twintproject/twint.git@origin/master#egg=twint;
  • [x] I have searched the issues and there are no duplicates of this issue/question/request.

Command Ran

import twint

c = twint.Config()

c.Username = "Resister_Charli"
c.Since = "2019-05-01"
c.Format = "Tweet id: {id} | Conversation ID: {conversation_id} | Date: {date} | Likes: {likes} | Username: {username}"

twint.run.Search(c)

Description of Issue

This is with reference to issue #482 and #464.

There seems to be some problem with conversation_id in terms of formatting, but it could be a problem on my side. Or is it that you are supposed to use conversation_id as a module?

An example of a result obtained:
Tweet id: 1145177847222325248 | Conversation ID: {conversation_id} | Date: 2019-06-30 | Likes: 0 | Username: Resister_Charli

I have checked the library of twint and found out that you might have missed conversation_id out in format.py.

def Tweet(config, t):
    if config.Format:
        logme.debug(__name__+':Tweet:Format')
        output = config.Format.replace("{id}", t.id_str)
        output = output.replace("{date}", t.datestamp)
        output = output.replace("{time}", t.timestamp)
        output = output.replace("{user_id}", t.user_id_str)
        output = output.replace("{username}", t.username)
        output = output.replace("{timezone}", t.timezone)
        output = output.replace("{tweet}", t.tweet)
        output = output.replace("{location}", t.location)
        output = output.replace("{hashtags}", str(t.hashtags))
        output = output.replace("{cashtags}", str(t.cashtags))
        output = output.replace("{replies}", t.replies_count)
        output = output.replace("{retweets}", t.retweets_count)
        output = output.replace("{likes}", t.likes_count)
        output = output.replace("{link}", t.link)
        output = output.replace("{is_retweet}", str(t.retweet))
        output = output.replace("{mentions}", str(t.mentions))

Environment Details

Windows 10, Python 3.6

Once again, thank you for your hard work you have put into this! 馃馃憤 It has helped my group members and I in our project greatly!

Most helpful comment

Now you should be able to format the output displaying all the fields available!

All 2 comments

Now you should be able to format the output displaying all the fields available!

It worked! Thanks again!

Was this page helpful?
0 / 5 - 0 ratings