Skip to content

Get twitter:card data #290

@Cavanna-dev

Description

@Cavanna-dev

Hi there,

Is there a possibility to get the twitter:card data from any provider?

It seems the $info->type; //The page type (link, video, image, rich) is not what I want :(.

I tried with the HTML provider but I can't access the twitter:card too. Or maybe I miss use?

Here is an example where I need to get the twitter:card value:
https://oscarotero.com/embed3/demo/index.php?url=https%3A%2F%2Fbits.blogs.nytimes.com%2F2011%2F12%2F08%2Fa-twitter-for-my-sister%2F
In the webpage => <meta name="twitter:card" value="summary">
But I get:

$info = Embed::create($url); // $info->getType() === 'rich'

If I try this way:

$providers = $info->getProviders();
$twitterProvider = $providers['twittercards']; // $twitterProvider->getType() === null

I need to get the value because summary and summary_large_image are not displaying the same way. Hope you can help me on this :).

Thanks for the great lib btw, you did a really good job ! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions