Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] No Header on CSV Result #7

Open
3 tasks done
NexiaMoe opened this issue Mar 15, 2022 · 3 comments
Open
3 tasks done

[BUG] No Header on CSV Result #7

NexiaMoe opened this issue Mar 15, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@NexiaMoe
Copy link

NexiaMoe commented Mar 15, 2022

Initial Check

  • Python version is 3.6 or later;
  • Updated Twint with pip3 install --user --upgrade -e git+https://github.com/minamotorin/twint.git@origin/master#egg=twint;
  • I have searched the issues and there are no duplicates of this issue/question/request (please link to related issues of twintproject/twint for reference).

Command Ran

I'm using twint as module, here code I use :

c = twint.Config()
c.To = "JeniusConnect"
c.Replies = False
c.Retweets = False
c.Store_csv = True
c.Output = "JeniusConnect.csv"
c.Custom['tweet'] = ["id", 'date', 'time', 'user_id', 'username', 'name', 'tweet']
c.Since = '2022-03-10'
c.Until = '2022-03-14'

twint.run.Search(c)

Description of Issue

Using Output as CSV and Store_csv = True, Result of CSV is correct but no header, the original twint have header when file is not exist or empty. Is it bug ?

It's not a problem for me, just it not convenient since I need to make it automate,

Environment Details

Using Windows 11 with WSL Ubuntu 20.04, run with python file (Twint as module)

@minamotorin
Copy link
Owner

Hi.

After running the code, the result of cat JeniusConnect.csv | head -1 (get the first line of JeniusConnect.csv) is id,date,time,user_id,username,name,tweet in my environment.

What does “no header” mean? or is this different from your environment?

@minamotorin minamotorin added the bug Something isn't working label Mar 15, 2022
@NexiaMoe
Copy link
Author

My Bad, if file is not exist, it will add header

but if file exist, and it empty, it will not add header, but in original twint, it will add header if file exist.

@minamotorin
Copy link
Owner

I tested your code using the original twint, but the original twint didn't add header if file exists and is empty.
The first line of JeniusConnect.csv is 1503154389866844163,2022-03-13,23:41:48,1351839832079650818,tchamomilee,ChuSangchuuu~,(tweet text).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants