Did twitter block my server?

Hi,
I’m running a forum using Simple machines.

It has some function allowing users to embed tweets in their posts. This uses the twitter API to retrieve a tweet.

This worked fine for a long time, but since a few days i’m not getting any tweets anymore.

I’m getting an error stating the TCP connection reset by peer .
I have this part of code:
<?php

$tweet = 1163869660086861825;

$twitterapi_url = “https://api.twitter.com/1/statuses/oembed.json?id=”;

$twitterapi_url = $twitterapi_url . $tweet;

if (function_exists(‘curl_init’)) {

$curl = curl_init($twitterapi_url);

curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($curl,CURLOPT_SSL_VERIFYPEER, FALSE);

$response = curl_exec($curl);

var_dump($response);

curl_close($curl);

}

?&gt;

On my server it generates the error, on other machines i tested on it returns the JSON as expected.
Did twitter block my server?

Hello there.
The first observation I have is that https://api.twitter.com/1/statuses/oembed.json is not a valid API URL. version 1 of the Twitter API was retired over 7 years ago. You should be using publish.twitter.com/oembed.json.
Since you say this has only just started happening, and you are seeing a TCP error, my suspicion is that your server is not compatible with TLS 1.2.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.