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
5c4e897e
Commit
5c4e897e
authored
Apr 11, 2018
by
Francesco Poldi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tables for followers and following
parent
ff66050b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
twint.py
twint.py
+33
-0
No files found.
twint.py
View file @
5c4e897e
...
@@ -86,6 +86,26 @@ def initdb(db):
...
@@ -86,6 +86,26 @@ def initdb(db):
);
);
"""
"""
cursor
.
execute
(
table_search
)
cursor
.
execute
(
table_search
)
table_followers
=
"""
CREATE TABLE IF NOT EXISTS
followers (
user text not null,
date_update text not null,
follower text not null,
PRIMARY KEY (user, follower)
);
"""
cursor
.
execute
(
table_followers
)
table_following
=
"""
CREATE TABLE IF NOT EXISTS
following (
user text not null,
date_update text not null,
follows text not null,
PRIMARY KEY (user, follows)
);
"""
cursor
.
execute
(
table_following
)
return
conn
return
conn
except
Exception
as
e
:
except
Exception
as
e
:
return
str
(
e
)
return
str
(
e
)
...
@@ -543,6 +563,19 @@ async def outFollow(f):
...
@@ -543,6 +563,19 @@ async def outFollow(f):
output
=
user
output
=
user
if
arg
.
database
:
try
:
date_time
=
str
(
datetime
.
datetime
.
now
())
cursor
=
conn
.
cursor
()
entry
=
(
arg
.
u
,
date_time
,
user
,)
if
arg
.
followers
:
cursor
.
execute
(
'INSERT INTO followers VALUES(?,?,?)'
,
entry
)
else
:
cursor
.
execute
(
'INSERT INTO following VALUES(?,?,?)'
,
entry
)
conn
.
commit
()
except
sqlite3
.
IntegrityError
:
# this happens if the entry is already in the db
pass
if
arg
.
o
!=
None
:
if
arg
.
o
!=
None
:
print
(
output
,
file
=
open
(
arg
.
o
,
"a"
,
encoding
=
"utf-8"
))
print
(
output
,
file
=
open
(
arg
.
o
,
"a"
,
encoding
=
"utf-8"
))
...
...
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