twint icon indicating copy to clipboard operation
twint copied to clipboard

Wiki Mistakes: attributes for custom formatting

Open batmanscode opened this issue 4 years ago • 2 comments
trafficstars

Wiki needs a minor update

Using datestamp from tweet attributes returns and error. It works when using date instead.

Code to test

This works

import twint
import nest_asyncio

nest_asyncio.apply()

c = twint.Config()
c.Search = "bitcoin"
c.Min_likes = 2500
c.Custom["tweet"] = ["date", "tweet"]

twint.run.Search(c)

This doesn't

import twint
import nest_asyncio

nest_asyncio.apply()

c = twint.Config()
c.Search = "bitcoin"
c.Min_likes = 2500
c.Custom["tweet"] = ["datestamp", "tweet"]

twint.run.Search(c)

batmanscode avatar Jun 26 '21 13:06 batmanscode

Update

In Wiki What Actually Works Where
datestamp date tweet attributes
timestamp time tweet attributes
avatar profile_image_url user attributes

batmanscode avatar Jul 05 '21 15:07 batmanscode

~Hi all, looks like the "created_at" attribute doesn't work either~

Cancel cancel, I didn't realise that the attributes you use in the .Format() sub don't match with the ones you use in the .custom sub

charliehawco avatar May 02 '22 19:05 charliehawco