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
086a6bb1
Commit
086a6bb1
authored
May 26, 2018
by
Cody Zacharias
Committed by
GitHub
May 26, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update feed.py
parent
6aa4d5e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
29 deletions
+34
-29
twint/feed.py
twint/feed.py
+34
-29
No files found.
twint/feed.py
View file @
086a6bb1
...
@@ -3,36 +3,41 @@ import json
...
@@ -3,36 +3,41 @@ import json
import
re
import
re
def
Follow
(
response
):
def
Follow
(
response
):
soup
=
BeautifulSoup
(
response
,
"html.parser"
)
soup
=
BeautifulSoup
(
response
,
"html.parser"
)
follow
=
soup
.
find_all
(
"td"
,
"info fifty screenname"
)
follow
=
soup
.
find_all
(
"td"
,
"info fifty screenname"
)
cursor
=
soup
.
find_all
(
"div"
,
"w-button-more"
)
cursor
=
soup
.
find_all
(
"div"
,
"w-button-more"
)
try
:
try
:
cursor
=
re
.
findall
(
r'cursor=(.*?)">'
,
str
(
cursor
))[
0
]
cursor
=
re
.
findall
(
r'cursor=(.*?)">'
,
str
(
cursor
))[
0
]
except
:
except
:
pass
pass
return
follow
,
cursor
return
follow
,
cursor
def
Favorite
(
response
):
def
Favorite
(
response
):
soup
=
BeautifulSoup
(
response
,
"html.parser"
)
soup
=
BeautifulSoup
(
response
,
"html.parser"
)
tweets
=
soup
.
find_all
(
"span"
,
"metadata"
)
tweets
=
soup
.
find_all
(
"span"
,
"metadata"
)
max_id
=
soup
.
find_all
(
"div"
,
"w-button-more"
)
max_id
=
soup
.
find_all
(
"div"
,
"w-button-more"
)
try
:
try
:
max_id
=
re
.
findall
(
r'max_id=(.*?)">'
,
str
(
max_id
))[
0
]
max_id
=
re
.
findall
(
r'max_id=(.*?)">'
,
str
(
max_id
))[
0
]
except
:
except
:
pass
pass
return
tweets
,
max_id
return
tweets
,
max_id
def
Initial
(
response
):
def
profile
(
response
):
soup
=
BeautifulSoup
(
response
,
"html.parser"
)
json_response
=
json
.
loads
(
response
)
feed
=
soup
.
find_all
(
"li"
,
"js-stream-item"
)
html
=
json_response
[
"items_html"
]
init
=
"TWEET={}-{}"
.
format
(
feed
[
-
1
][
"data-item-id"
],
feed
[
0
][
"data-item-id"
])
soup
=
BeautifulSoup
(
html
,
"html.parser"
)
return
feed
,
init
feed
=
soup
.
find_all
(
"li"
,
"js-stream-item"
)
return
feed
,
feed
[
-
1
][
"data-item-id"
]
def
Cont
(
response
):
def
Json
(
response
):
json_response
=
json
.
loads
(
response
)
json_response
=
json
.
loads
(
response
)
html
=
json_response
[
"items_html"
]
html
=
json_response
[
"items_html"
]
soup
=
BeautifulSoup
(
html
,
"html.parser"
)
soup
=
BeautifulSoup
(
html
,
"html.parser"
)
feed
=
soup
.
find_all
(
"li"
,
"js-stream-item"
)
feed
=
soup
.
find_all
(
"li"
,
"js-stream-item"
)
split
=
json_response
[
"min_position"
]
.
split
(
"-"
)
split
=
json_response
[
"min_position"
]
.
split
(
"-"
)
split
[
1
]
=
feed
[
-
1
][
"data-item-id"
]
split
[
1
]
=
feed
[
-
1
][
"data-item-id"
]
return
feed
,
"-"
.
join
(
split
)
return
feed
,
"-"
.
join
(
split
)
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