-
-
Notifications
You must be signed in to change notification settings - Fork 309
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
Images blacklist #54
Comments
Hi, that's a great idea, and it's not difficult to implement. How about something like this? $config = [
'adapter' => [
'config' => [
'minImageWidth' => 16,
'minImageHeight' => 16,
'imagesBlacklist' => [
'http?://ads.com/*',
'*banners/*',
]
]
]
]; |
I didn't think about regex, good catch! But, will not regexp be annoying to make with special chars like Maybe something like this? $config = [
'adapter' => [
'config' => [
'minImageWidth' => 16,
'minImageHeight' => 16,
'imagesBlacklist' => [
'plain' => [
'http://example.com/full/path/to/image.png'
],
'regex' => [
'http?://ads.com/*',
'*banners/*',
]
]
]
]
]; |
Well, that's not really a regex, it's a url string that can contain two special chars: This is used already in many places, for example for oembed patterns (https://github.com/oscarotero/Embed/blob/master/src/Providers/OEmbed/Instagram.php#L21), so you can do this: $config = [
'adapter' => [
'config' => [
'minImageWidth' => 16,
'minImageHeight' => 16,
'imagesBlacklist' => [
'http://example.com/full/path/to/image.png',
'http?://ads.com/*',
'*banners/*',
]
]
]
]; |
Ok, let's do this so! 👍 Do you have time to do it soon? If you want, I can work for a PR this evening. |
I wont have time today, so pull requests are welcome. |
Ok I will take a look, thanks. |
I'm woking on it. If I try this var_dump for testing: public function getImagesUrls()
{
$data = Utils::getData($this->providers, 'imagesUrls', $this->request->url);
var_dump($data);
return $data;
} I sometime got this:
Is that normal? What sould I suppose to do with that? Nothing? |
|
Many URLs with this kind of result. But, if I dump For example:
Maybe they are filtered on getImages? I think I should filter for the blacklist here instead of |
|
Ok so two goals now for my PR:
All on |
👍 |
I close to continue on #55. |
Hi, little feature idea.
What about images blacklist?
Some website always return their logo or whatever useless on open-graph.
Maybe can we have a blacklist solution to ignore some images url?
Thanks.
The text was updated successfully, but these errors were encountered: