Skip to content

Commit

Permalink
add include_ext_is_blue_verified params
Browse files Browse the repository at this point in the history
  • Loading branch information
igorbrigadir committed Feb 11, 2023
1 parent ae7a161 commit dec1650
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions twarc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def search(
"count": 100,
"q": q,
"include_ext_alt_text": "true",
"include_ext_is_blue_verified": "true",
"include_entities": "true",
}

Expand Down Expand Up @@ -278,7 +279,12 @@ def timeline(
else:
url = "https://api.twitter.com/1.1/statuses/home_timeline.json"

params = {"count": 200, id_type: id, "include_ext_alt_text": "true"}
params = {
"count": 200,
id_type: id,
"include_ext_alt_text": "true",
"include_ext_is_blue_verified": "true",
}

retrieved_pages = 0
reached_end = False
Expand Down Expand Up @@ -352,7 +358,10 @@ def do_lookup():
ids_str = ",".join(lookup_ids)
log.info("looking up users %s", ids_str)
url = "https://api.twitter.com/1.1/users/lookup.json"
params = {id_type: ids_str}
params = {
id_type: ids_str,
"include_ext_is_blue_verified": "true",
}
try:
resp = self.get(url, params=params, allow_404=True)
except requests.exceptions.HTTPError as e:
Expand Down Expand Up @@ -462,7 +471,11 @@ def filter(
locations = locations.replace("\\", "")

url = "https://stream.twitter.com/1.1/statuses/filter.json"
params = {"stall_warning": True, "include_ext_alt_text": True}
params = {
"stall_warning": True,
"include_ext_alt_text": True,
"include_ext_is_blue_verified": "true",
}
if track:
params["track"] = track
if follow:
Expand Down Expand Up @@ -611,6 +624,7 @@ def hydrate(self, iterator, trim_user=False):
data={
"id": ",".join(ids),
"include_ext_alt_text": "true",
"include_ext_is_blue_verified": "true",
"include_entities": "true",
"trim_user": trim_user,
},
Expand All @@ -629,6 +643,7 @@ def hydrate(self, iterator, trim_user=False):
data={
"id": ",".join(ids),
"include_ext_alt_text": "true",
"include_ext_is_blue_verified": "true",
"include_entities": "true",
"trim_user": trim_user,
},
Expand Down

0 comments on commit dec1650

Please sign in to comment.