Please tell me how to determine the response when I request to the post URL on Twitter.

Asked 2 months ago, Updated 2 months ago, 3 views

Prerequisites/What you want to achieve

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.

Problems/Error Messages you are experiencing

  • Extract the post URL tweeted by one month's members
    → This is done without any problems.
  • Effectiveness of each post
    →About 4 months ago, I was able to distinguish it from the php file that I used before, but
    I wonder if Twitter's specifications have changed, but everything will be returned with 200 numbers.

Source Codes Affected

Previously, it was retrieved and determined by this function.

@get_headers();

Tried

  • Check all response headers → No particular useful information
  • Try changing the get_headers argument → no change
  • Google how to get the redirect destination URL→get_header but
    It probably came back with 200, so the header does not contain the redirect destination URL
  • curl-I Enter the appropriate string for the post ID with the command.

Supplementary information (for example, FW/Tool Version)

If you need any other information, please let me know!

php http twitter curl

2022-09-30 12:06

1 Answers

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.


2022-09-30 12:06

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.