Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embedTweet.php throws exception #2

Closed
codingmatty opened this issue Feb 24, 2015 · 4 comments
Closed

embedTweet.php throws exception #2

codingmatty opened this issue Feb 24, 2015 · 4 comments

Comments

@codingmatty
Copy link

codingmatty commented Feb 24, 2015

Undefined property: stdClass::$html

protected function loadTweetContent()
{
    $json = json_decode(Http::get('https://api.twitter.com/1/statuses/oembed.json', function($http){
        $http->data($this->getProperties());
    })->body);

    return $json->html;
}

}

@cilsilver
Copy link

Same has me, having same problem for over 4hours.

protected function loadTweetContent()
{
$json = json_decode(Http::get('https://api.twitter.com/1/statuses/oembed.json', function($http){
$http->data($this->getProperties());
})->body);

    return $json->html;
}

}

@daftspunk
Copy link
Member

This might occur when Twitter's API is down, we should add some exception handling to grab it.

@bnordland
Copy link

bnordland commented Dec 28, 2016

This also uses Twitter API Version 1 which is no longer supported:
https://api.twitter.com/1/statuses/ returns: The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.

Rather than a Tweet ID, it now takes a tweet URL: https://www.hitchhq.com/twitter/activities/get-statusesoembed-575981a88e2e411000b8e5d4

Updated documentation: https://dev.twitter.com/rest/reference/get/statuses/oembed
Example: ttps://publish.twitter.com/oembed?url=https%3A%2F%2Ftwitter.com%2FInterior%2Fstatus%2F507185938620219395

I would recommend switching over to the new API at the same time as adding extra error handling.

@LukeTowers
Copy link

Closing as it has been over a month since any activity on this occurred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants