Extract the post URL tweeted by the member for one month
I want to make sure that each post is valid.
Specifically,
https://twitter.com/ Account Name/status/Post ID
If is enabled and the post is displayed, number 200 is OK
https://twitter.com/ Account Name/status/Post ID
Redirect #302 if is a private account
https://twitter.com/ Account Name/status/Post ID
If is not found, number 404 not found
I'd like to make a decision like this.
Previously, it was retrieved and determined by this function.
@get_headers();
get_headers
argument → no changeget_header
but curl-I
Enter the appropriate string for the post ID with the command.If you need any other information, please let me know!
php http twitter curl
About 4 months ago, I was able to determine it by checking the php file I used before.
I wonder if Twitter's specifications have changed, but everything will be returned with 200 numbers.
In this regard, the behavior of Twitter web has changed since the beginning of 2020.
Consider using the Twitter API if you want to behave yourself (that is, not overload your Twitter server more than you need).For example, if you want to confirm the existence of a tweet, you can use GET states/show/:id or GET states/lookup:
However, it is necessary to use the API to determine if it is a protected user.
© 2024 OneMinuteCode. All rights reserved.