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
0d1840c5
Commit
0d1840c5
authored
Mar 19, 2019
by
Francesco Poldi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/twintproject/twint
parents
a0e66068
0d904a05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
18 deletions
+15
-18
README.md
README.md
+0
-12
twint/run.py
twint/run.py
+15
-6
No files found.
README.md
View file @
0d1840c5
...
...
@@ -24,18 +24,6 @@ Some of the benefits of using Twint vs Twitter API:
## Installing
### Stable version
**Pip:**
```
bash
pip3
install
twint
```
**Pipenv**
:
```
bash
pipenv
install
twint
```
### Development version
**Git:**
```
bash
git clone https://github.com/twintproject/twint.git
...
...
twint/run.py
View file @
0d1840c5
import
sys
,
os
from
asyncio
import
get_event_loop
,
TimeoutError
from
asyncio
import
get_event_loop
,
TimeoutError
,
ensure_future
from
datetime
import
timedelta
,
datetime
from
.
import
datelock
,
feed
,
get
,
output
,
verbose
,
storage
...
...
@@ -131,7 +131,16 @@ class Twint:
self
.
count
+=
1
await
output
.
Tweets
(
tweet
,
""
,
self
.
config
,
self
.
conn
)
async
def
main
(
self
):
async
def
main
(
self
,
callback
=
None
):
task
=
ensure_future
(
self
.
run
())
# Might be changed to create_task in 3.7+.
if
callback
:
task
.
add_done_callback
(
callback
)
await
task
async
def
run
(
self
):
self
.
user_agent
=
await
get
.
RandomUserAgent
()
if
self
.
config
.
User_id
is
not
None
:
logme
.
debug
(
__name__
+
':Twint:main:user_id'
)
...
...
@@ -186,9 +195,9 @@ class Twint:
if
self
.
config
.
Count
:
verbose
.
Count
(
self
.
count
,
self
.
config
)
def
run
(
config
):
def
run
(
config
,
callback
=
None
):
logme
.
debug
(
__name__
+
':run'
)
get_event_loop
()
.
run_until_complete
(
Twint
(
config
)
.
main
())
get_event_loop
()
.
run_until_complete
(
Twint
(
config
)
.
main
(
callback
))
def
Favorites
(
config
):
logme
.
debug
(
__name__
+
':Favorites'
)
...
...
@@ -234,11 +243,11 @@ def Profile(config):
config
.
Profile
=
True
run
(
config
)
def
Search
(
config
):
def
Search
(
config
,
callback
=
None
):
logme
.
debug
(
__name__
+
':Search'
)
config
.
TwitterSearch
=
True
config
.
Following
=
False
config
.
Followers
=
False
run
(
config
)
run
(
config
,
callback
)
if
config
.
Pandas_au
:
storage
.
panda
.
_autoget
(
"tweet"
)
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