Skip to content

Commit

Permalink
facebook: apply meta fallback only to FB
Browse files Browse the repository at this point in the history
  • Loading branch information
iparamonau committed Jul 24, 2024
1 parent c29ce0f commit 4b30342
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ export default {

provides: 'meta',

re: [
'facebook.post',
'facebook.video'
],

getData: function(url, __statusCode, options, cb) {

return __statusCode !== 429 && __statusCode !== 403 &&__statusCode !== 508
Expand All @@ -12,7 +17,7 @@ export default {

: cb(null, {
meta: {},
message: `${options.provider || 'Publisher'} is rate-limiting. Meta disabled.`
message: `Facebook is rate-limiting. Meta disabled.`
})
}
};
4 changes: 2 additions & 2 deletions plugins/domains/facebook.com/facebook.thumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
'facebook.video'
],

mixins: ['meta-fallback'],
mixins: ['facebook.meta-fallback'],

getLink: function(url, __allowFBThumbnail, options, meta) {

Expand Down Expand Up @@ -72,6 +72,6 @@ export default {
tests: [{
noFeeds: true,
skipMethods: ['getData', 'getLink'],
skipMixins: ['meta-fallback']
skipMixins: ['facebook.meta-fallback']
}]
};

0 comments on commit 4b30342

Please sign in to comment.