Commit 509530ae authored by Cody Zacharias's avatar Cody Zacharias Committed by GitHub

1.1.3 Update

parent f12707de
from bs4 import BeautifulSoup from bs4 import BeautifulSoup
import json from re import findall
import re from json import loads
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 = findall(r'cursor=(.*?)">', str(cursor))[0]
except: except:
pass pass
return follow, cursor return follow, cursor
def Favorite(response): def Mobile(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 = findall(r'max_id=(.*?)">', str(max_id))[0]
except: except:
pass pass
return tweets, max_id return tweets, max_id
def profile(response): def profile(response):
json_response = json.loads(response) json_response = 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")
...@@ -33,7 +33,7 @@ def profile(response): ...@@ -33,7 +33,7 @@ def profile(response):
return feed, feed[-1]["data-item-id"] return feed, feed[-1]["data-item-id"]
def Json(response): def Json(response):
json_response = json.loads(response) json_response = 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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment