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

Fix Twitter scrape #2

Closed
AndreiIgna opened this issue Sep 27, 2020 · 3 comments
Closed

Fix Twitter scrape #2

AndreiIgna opened this issue Sep 27, 2020 · 3 comments

Comments

@AndreiIgna
Copy link
Member

Twitter info is not scraped anymore, after twitter.com site update

@PVGrad
Copy link

PVGrad commented Nov 20, 2020

@AndreiIgna
I've managed to parse twitter meta with this init:

$preview = new Layered\PageMeta\UrlPreview([
    'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',
]);
$preview->loadUrl('https://twitter.com/ArcticMonkeys/status/1327247088485240832');
$info  = $preview->getAll();

so the difference is in custom HTTP_USER_AGENT

@AndreiIgna
Copy link
Member Author

Thanks @PVGrad, that's a clever solution.

I will add this in the project description, so it's easy to spot

@AndreiIgna
Copy link
Member Author

This info is added in Readme now UrlPreview::getAll() and mentioned you for the tip, hope that's okay.

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

No branches or pull requests

2 participants