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

Refactor patterns and instances to allow excluding patterns #37

Open
e-moran opened this issue Mar 11, 2025 · 0 comments · May be fixed by #38
Open

Refactor patterns and instances to allow excluding patterns #37

e-moran opened this issue Mar 11, 2025 · 0 comments · May be fixed by #38

Comments

@e-moran
Copy link
Contributor

e-moran commented Mar 11, 2025

When investigating #36 I learned that the standard iMessage Preview UA is:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.4 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.4 facebookexternalhit/1.1 Facebot Twitterbot/1.0

Which will overlap with both facebookexternalhit and twitter bot, both are already in the list.

Proposed Solution

Refactor the patterns key in the json to be an object containing include and exclude. You could then define iMessage Crawler like this:

{
  "id": "imessage-preview",
  "patterns": {
    "include": ["facebookexternalhit", "Twitterbot"],
    "exclude": []
  }
}

And you could define Twitter Bot like this:

{
  "id": "imessage-preview",
  "patterns": {
    "include": ["Twitterbot"],
    "exclude": ["facebookexternalhit"]
  }
}

The instances key should be updated similarly so that we can test that the excluding patterns work correctly in validate.js

@e-moran e-moran linked a pull request Mar 13, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant