Twitter API

https://developer.twitter.com/en/docs https://developer.twitter.com/en/portal/dashboard

API key = Consumer Key WpObptDu283v09OvUw9VvwWE2

API secret key = Consumer Secret 8bE2C1BFuAhFsgZqcrJ5phfNpC771r3CWHA3wRSnhzDyCYJUc0

Bearer token AAAAAAAAAAAAAAAAAAAAAFlGIAEAAAAA%2Bil1W6VmTrrObnBSCec2B8d7fLY%3DzemvhOhjGuWHBaWC9BAh7O3UEbuzycwcZGOhglXYLHV9lB4A5x

分かりやすい https://syncer.jp/Web/API/Twitter/REST_API/#section-5

TWITTER_BEARER_TOKEN="AAAAAAAAAAAAAAAAAAAAAFlGIAEAAAAA%2Bil1W6VmTrrObnBSCec2B8d7fLY%3DzemvhOhjGuWHBaWC9BAh7O3UEbuzycwcZGOhglXYLHV9lB4A5x"

OAUTH_CONSUMER_KEY=WpObptDu283v09OvUw9VvwWE2
OAUTH_NONCE=abcdefghiklmnopqrstuvwxyz
OAUTH_CALLBACK=https%3A%2F%2Ffindlostpets.yh1224.com%2Fcallback
curl -v -X POST "https://api.twitter.com/oauth/request_token" \
    -H "Accept: application/json" \
    -H "Authorization: OAuth oauth_nonce=\"${OAUTH_NONCE}\", oauth_callback=\"${OAUTH_CALLBACK}\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"$(date +%s)\", oauth_consumer_key=\"${OAUTH_CONSUMER_KEY}\", oauth_version=\"1.0\"" \
    -d "oauth_callback=${OAUTH_CALLBACK}"



OAUTH_CONSUMER_KEY=WpObptDu283v09OvUw9VvwWE2
OAUTH_SIGNATURE=
OAUTH_NONCE=kYjzVBB8Y0ZFabxSWbWovY3uYSQ2pTgmZeNu2VS4cg
OAUTH_CALLBACK=https%3A%2F%2Ffindlostpetsjp.yh1224.com%2Fcallback
curl -v -X POST "https://api.twitter.com/oauth/request_token" \
    -H "Accept: application/json" \
    -H "Authorization: OAuth oauth_nonce=\"${OAUTH_NONCE}\", oauth_callback=\"${OAUTH_CALLBACK}\", oauth_signature_method=\"HMAC-SHA1\", oauth_timestamp=\"$(date +%s)\", oauth_consumer_key=\"${OAUTH_CONSUMER_KEY}\", oauth_signature=\"${OAUTH_SIGNATURE}\", oauth_version=\"1.0\""



curl -v -X POST "https://api.twitter.com/1.1/statuses/update.json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer ${TWITTER_BEARER_TOKEN}" \
    -d "status=TEST"

https://api.twitter.com/oauth/authorize?oauth_token=BpcVzQAAAAABIEZZAAABdM8865w ↓ https://findlostpetsjp.yh1224.com/callback?oauth_token=BpcVzQAAAAABIEZZAAABdM8865w&oauth_verifier=lO5O7TCnkaxavQbFTZmiTxZzXLnfrLHG ↓

oauth_token: 1309810783614771200-yGIKA4jkr2v9gmQQDedYUlG6nFiSRd oauth_token_secret: 18tcIHru7aAhMB5J73N6qhRQIJs3EepOIzngmrBzH1HFD user_id: 1309810783614771200 screen_name: findlostpetsjp

TwitterApiKey="WpObptDu283v09OvUw9VvwWE2" TwitterApiSecretKey="8bE2C1BFuAhFsgZqcrJ5phfNpC771r3CWHA3wRSnhzDyCYJUc0" TwitterAccessToken="1309810783614771200-yGIKA4jkr2v9gmQQDedYUlG6nFiSRd" TwitterAccessTokenSecret="18tcIHru7aAhMB5J73N6qhRQIJs3EepOIzngmrBzH1HFD"