Skip to content

examples.print_user_archive() #18

Description

@JoseCR99

I have the following error:

In [5]: examples.print_user_archive()

TypeError Traceback (most recent call last)
in ()
----> 1 examples.print_user_archive()

/home/ubuntu/twitterresearch/examples.pyc in print_user_archive()
111 """
112 archive_generator = rest.fetch_user_archive("lessig")
--> 113 for page in archive_generator:
114 for tweet in page:
115 print_tweet(tweet)

/home/ubuntu/twitterresearch/rest.pyc in fetch_user_archive(user, **kwargs)
261 # If we have a valid max_id, use that; else do a simple normal request
262 result, tweets = fetch_user_tweets(
--> 263 user, max_id=max_id, **kwargs) if max_id else fetch_user_tweets(user)
264 # Set the status variable - if it's not 200, that's an error and the loop exits
265 status = result.status_code

/home/ubuntu/twitterresearch/rest.pyc in fetch_user_tweets(user, **kwargs)
237 elif isinstance(user, str):
238 kwargs['screen_name'] = user
--> 239 result = throttled_call(USER_TIMELINE_URL, params=kwargs)
240 # Decode JSON
241 return (result, json.loads(result.text))

/home/ubuntu/twitterresearch/rest.pyc in wrapper(*args, **kwargs)
141 patched_data = lengthen_text(response_json)
142 # Monkey patching since .text and .content are read-only
--> 143 response._content = bytes(json.dumps(patched_data), encoding='utf-8')
144 return response
145 return wrapper

TypeError: str() takes at most 1 argument (2 given)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions