Skip to content

Commit 4f73166

Browse files
fionapigottAaron Gonzales
authored andcommitted
add a User-Agent string (twitterdev-search-tweets-python/version) to … (#32)
* add a User-Agent string (twitterdev-search-tweets-python/version) to the request header (#30) * bump minor version number to 1.7.0 (#32)
1 parent 7c30118 commit 4f73166

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

searchtweets/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Copyright 2018 Twitter, Inc.
33
# Licensed under the MIT License
44
# https://opensource.org/licenses/MIT
5-
VERSION = "1.6.0"
5+
VERSION = "1.7.0"

searchtweets/result_stream.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
from .api_utils import infer_endpoint, change_to_count_endpoint
2525

26+
from ._version import VERSION
2627

2728
logger = logging.getLogger(__name__)
2829

@@ -44,7 +45,8 @@ def make_session(username=None, password=None, bearer_token=None):
4445
raise KeyError
4546

4647
session = requests.Session()
47-
headers = {'Accept-encoding': 'gzip'}
48+
headers = {'Accept-encoding': 'gzip',
49+
'User-Agent': 'twitterdev-search-tweets-python/' + VERSION}
4850
if bearer_token:
4951
logger.info("using bearer token for authentication")
5052
headers['Authorization'] = "Bearer {}".format(bearer_token)

0 commit comments

Comments
 (0)