Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
Twint
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Twint
Commits
bdd1fe42
Commit
bdd1fe42
authored
Sep 21, 2018
by
Jake Creps
Committed by
GitHub
Sep 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create automate.py
parent
43e91b27
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
automate.py
automate.py
+65
-0
No files found.
automate.py
0 → 100644
View file @
bdd1fe42
import
twint
import
schedule
import
time
# you can change the name of each "job" after "def" if you'd like.
def
jobone
():
print
(
"Fetching Tweets"
)
c
=
twint
.
Config
()
# choose username (optional)
c
.
Username
=
"insert username here"
# choose search term (optional)
c
.
Search
=
"insert search term here"
# choose beginning time (narrow results)
c
.
Since
=
"2018-01-01"
# set limit on total tweets
c
.
Limit
=
1000
# no idea, but makes the csv format properly
c
.
Store_csv
=
True
# format of the csv
c
.
Custom
=
[
"date"
,
"time"
,
"username"
,
"tweet"
,
"link"
,
"likes"
,
"retweets"
,
"replies"
,
"mentions"
,
"hashtags"
]
# change the name of the csv file
c
.
Output
=
"filename.csv"
twint
.
run
.
Search
(
c
)
def
jobtwo
():
print
(
"Fetching Tweets"
)
c
=
twint
.
Config
()
# choose username (optional)
c
.
Username
=
"insert username here"
# choose search term (optional)
c
.
Search
=
"insert search term here"
# choose beginning time (narrow results)
c
.
Since
=
"2018-01-01"
# set limit on total tweets
c
.
Limit
=
1000
# no idea, but makes the csv format properly
c
.
Store_csv
=
True
# format of the csv
c
.
Custom
=
[
"date"
,
"time"
,
"username"
,
"tweet"
,
"link"
,
"likes"
,
"retweets"
,
"replies"
,
"mentions"
,
"hashtags"
]
# change the name of the csv file
c
.
Output
=
"filename2.csv"
twint
.
run
.
Search
(
c
)
# run once when you start the program
jobone
()
jobtwo
()
# run every minute(s), hour, day at, day of the week, day of the week and time. Use "#" to block out which ones you don't want to use. Remove it to active. Also, replace "jobone" and "jobtwo" with your new function names (if applicable)
# schedule.every(1).minutes.do(jobone)
schedule
.
every
()
.
hour
.
do
(
jobone
)
# schedule.every().day.at("10:30").do(jobone)
# schedule.every().monday.do(jobone)
# schedule.every().wednesday.at("13:15").do(jobone)
# schedule.every(1).minutes.do(jobtwo)
schedule
.
every
()
.
hour
.
do
(
jobtwo
)
# schedule.every().day.at("10:30").do(jobtwo)
# schedule.every().monday.do(jobtwo)
# schedule.every().wednesday.at("13:15").do(jobtwo)
while
True
:
schedule
.
run_pending
()
time
.
sleep
(
1
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment