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

The previous version did not allow for getting a csv for both tweet d… #1336

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file added .vs/slnx.sqlite
Binary file not shown.
26 changes: 26 additions & 0 deletions customData.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import twint
c = twint.Config()

#search term
c.Search = "guns"
#account to get tweets from
c.Username = "POTUS"

#info wanted about tweet
c.Custom["tweet"] = ["id", "tweet"]
#info wanted about user
c.Custom["user"] = ["bio"]

#output as csv
c.Store_csv = True
#put data in folder "data"
c.Output = "data"

twint.run.getCustomData(c)







16 changes: 15 additions & 1 deletion twint/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def Lookup(config):
config.Profile = False
config.Lookup = True
config.Favorites = False
config.FOllowing = False
config.Following = False
config.Followers = False
config.TwitterSearch = False
run(config)
Expand Down Expand Up @@ -410,3 +410,17 @@ def Search(config, callback=None):
run(config, callback)
if config.Pandas_au:
storage.panda._autoget("tweet")

def getCustomData(config):
if config.Username != None:
if config.Custom["tweet"] != None:
Search(config)
if config.Custom["user"] != None:
Lookup(config)
else:
Search(config)