とりあえずなので python3.9インストールと tweepyインストールしてみました。
python3.9 install

Python Release Python 3.9.10
The official home of the Python Programming Language
macOS 64-bit universal2 installer をダウンロードしてインストール
$ /Applications/Python\ 3.9/Install\ Certificates.command
インストール後、↑コマンドを実行して完了
$ python3 -V Python 3.9.10
tweepyをインストール
pip3 install tweepy
v1 v1.1を利用する tweepy.API のサンプルばかりなので tweepy.Clientの利用を
Client — tweepy 4.14.0 documentation
ユーザーデータ取得のサンプルです。
import tweepy
import re
import time
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
ACCESS_TOKEN_SECRET = ''
BAERER = ''
screen_name = ''
client = tweepy.Client( BAERER,
consumer_key=CONSUMER_KEY,
consumer_secret=CONSUMER_SECRET,
access_token=ACCESS_TOKEN,
access_token_secret=ACCESS_TOKEN_SECRET)
user = client.get_user(username=screen_name)



コメント